diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacsclient.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index ca184cbb034..eb2f7d9d6e9 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -325,10 +325,10 @@ main (argc, argv) | |||
| 325 | char *p = argv[i] + 1; | 325 | char *p = argv[i] + 1; |
| 326 | while (*p >= '0' && *p <= '9') p++; | 326 | while (*p >= '0' && *p <= '9') p++; |
| 327 | if (*p != 0) | 327 | if (*p != 0) |
| 328 | fprintf (out, "%s/", cwd); | 328 | fprintf (out, "%s/", quote_file_name (cwd)); |
| 329 | } | 329 | } |
| 330 | else if (*argv[i] != '/') | 330 | else if (*argv[i] != '/') |
| 331 | fprintf (out, "%s/", cwd); | 331 | fprintf (out, "%s/", quote_file_name (cwd)); |
| 332 | 332 | ||
| 333 | fprintf (out, "%s ", quote_file_name (argv[i])); | 333 | fprintf (out, "%s ", quote_file_name (argv[i])); |
| 334 | } | 334 | } |
| @@ -476,7 +476,8 @@ main (argc, argv) | |||
| 476 | modified_arg = quote_file_name (modified_arg); | 476 | modified_arg = quote_file_name (modified_arg); |
| 477 | 477 | ||
| 478 | if (need_cwd) | 478 | if (need_cwd) |
| 479 | used += strlen (cwd); | 479 | /* Overestimate in case we have to quote something in CWD. */ |
| 480 | used += 2 * strlen (cwd); | ||
| 480 | used += strlen (modified_arg) + 1; | 481 | used += strlen (modified_arg) + 1; |
| 481 | while (used + 2 > size_allocated) | 482 | while (used + 2 > size_allocated) |
| 482 | { | 483 | { |
| @@ -487,7 +488,7 @@ main (argc, argv) | |||
| 487 | } | 488 | } |
| 488 | 489 | ||
| 489 | if (need_cwd) | 490 | if (need_cwd) |
| 490 | strcat (msgp->mtext, cwd); | 491 | strcat (msgp->mtext, quote_file_name (cwd)); |
| 491 | 492 | ||
| 492 | strcat (msgp->mtext, modified_arg); | 493 | strcat (msgp->mtext, modified_arg); |
| 493 | strcat (msgp->mtext, " "); | 494 | strcat (msgp->mtext, " "); |