comparison src/os_unix.c @ 11908:1e8d353cb827 v8.0.0834

patch 8.0.0834: can't build without the client-server feature commit https://github.com/vim/vim/commit/2a4f06f370df0eb6fb77a05343604f5124ae5a11 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 1 18:44:29 2017 +0200 patch 8.0.0834: can't build without the client-server feature Problem: Can't build without the client-server feature. Solution: Add #ifdef.
author Christian Brabandt <cb@256bit.org>
date Tue, 01 Aug 2017 18:45:05 +0200
parents 3c1b59938042
children cca097489de5
comparison
equal deleted inserted replaced
11907:15b97761c033 11908:1e8d353cb827
4106 static char envbuf_Term[30]; 4106 static char envbuf_Term[30];
4107 static char envbuf_Rows[20]; 4107 static char envbuf_Rows[20];
4108 static char envbuf_Lines[20]; 4108 static char envbuf_Lines[20];
4109 static char envbuf_Columns[20]; 4109 static char envbuf_Columns[20];
4110 static char envbuf_Colors[20]; 4110 static char envbuf_Colors[20];
4111 # ifdef FEAT_CLIENTSERVER
4111 static char envbuf_Servername[60]; 4112 static char envbuf_Servername[60];
4113 # endif
4112 # endif 4114 # endif
4113 long colors = 4115 long colors =
4114 # ifdef FEAT_GUI 4116 # ifdef FEAT_GUI
4115 gui.in_use ? 256*256*256 : 4117 gui.in_use ? 256*256*256 :
4116 # endif 4118 # endif
4124 setenv("LINES", (char *)envbuf, 1); 4126 setenv("LINES", (char *)envbuf, 1);
4125 sprintf((char *)envbuf, "%ld", columns); 4127 sprintf((char *)envbuf, "%ld", columns);
4126 setenv("COLUMNS", (char *)envbuf, 1); 4128 setenv("COLUMNS", (char *)envbuf, 1);
4127 sprintf((char *)envbuf, "%ld", colors); 4129 sprintf((char *)envbuf, "%ld", colors);
4128 setenv("COLORS", (char *)envbuf, 1); 4130 setenv("COLORS", (char *)envbuf, 1);
4131 # ifdef FEAT_CLIENTSERVER
4129 setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1); 4132 setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1);
4133 # endif
4130 # else 4134 # else
4131 /* 4135 /*
4132 * Putenv does not copy the string, it has to remain valid. 4136 * Putenv does not copy the string, it has to remain valid.
4133 * Use a static array to avoid losing allocated memory. 4137 * Use a static array to avoid losing allocated memory.
4134 * This won't work well when running multiple children... 4138 * This won't work well when running multiple children...
4142 vim_snprintf(envbuf_Columns, sizeof(envbuf_Columns), 4146 vim_snprintf(envbuf_Columns, sizeof(envbuf_Columns),
4143 "COLUMNS=%ld", columns); 4147 "COLUMNS=%ld", columns);
4144 putenv(envbuf_Columns); 4148 putenv(envbuf_Columns);
4145 vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors); 4149 vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors);
4146 putenv(envbuf_Colors); 4150 putenv(envbuf_Colors);
4151 # ifdef FEAT_CLIENTSERVER
4147 vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername), 4152 vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername),
4148 "VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName); 4153 "VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName);
4149 putenv(envbuf_Servername); 4154 putenv(envbuf_Servername);
4155 # endif
4150 # endif 4156 # endif
4151 } 4157 }
4152 4158
4153 static void 4159 static void
4154 set_default_child_environment(void) 4160 set_default_child_environment(void)