aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index cacfaa8658f..f613daf21d5 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -251,19 +251,20 @@ main (argc, argv)
251 while (argc) 251 while (argc)
252 { 252 {
253 int need_cwd = 0; 253 int need_cwd = 0;
254 if (*argv[0] == '+') 254 char *modified_arg = argv[0];
255 if (*modified_arg == '+')
255 { 256 {
256 char *p = argv[0] + 1; 257 char *p = modified_arg + 1;
257 while (*p >= '0' && *p <= '9') p++; 258 while (*p >= '0' && *p <= '9') p++;
258 if (*p != 0) 259 if (*p != 0)
259 need_cwd = 1; 260 need_cwd = 1;
260 } 261 }
261 else if (*argv[0] != '/') 262 else if (*modified_arg != '/')
262 need_cwd = 1; 263 need_cwd = 1;
263 264
264 if (need_cwd) 265 if (need_cwd)
265 used += strlen (cwd); 266 used += strlen (cwd);
266 used += strlen (argv[0]) + 1; 267 used += strlen (modified_arg) + 1;
267 while (used + 2 > size_allocated) 268 while (used + 2 > size_allocated)
268 { 269 {
269 size_allocated *= 2; 270 size_allocated *= 2;
@@ -275,7 +276,7 @@ main (argc, argv)
275 if (need_cwd) 276 if (need_cwd)
276 strcat (msgp->mtext, cwd); 277 strcat (msgp->mtext, cwd);
277 278
278 strcat (msgp->mtext, argv[0]); 279 strcat (msgp->mtext, modified_arg);
279 strcat (msgp->mtext, " "); 280 strcat (msgp->mtext, " ");
280 argv++; argc--; 281 argv++; argc--;
281 } 282 }