summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1999-04-29 20:26:46 +0000
committerKarl Heuer <kwzh@gnu.org>1999-04-29 20:26:46 +0000
commit0343a01795fdcedba5c46e67a3527e7074f7a990 (patch)
tree00ae0e8a23302d8aa5ed588e0ace27ede1d2564a /lib-src
parent003a7eaa313fcbd74e484fd377f972b12685747c (diff)
downloademacs-0343a01795fdcedba5c46e67a3527e7074f7a990.tar.gz
(main, both versions): Use quote_file_name on cwd.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c9
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)
char *p = argv[i] + 1;
while (*p >= '0' && *p <= '9') p++;
if (*p != 0)
- fprintf (out, "%s/", cwd);
+ fprintf (out, "%s/", quote_file_name (cwd));
}
else if (*argv[i] != '/')
- fprintf (out, "%s/", cwd);
+ fprintf (out, "%s/", quote_file_name (cwd));
fprintf (out, "%s ", quote_file_name (argv[i]));
}
@@ -476,7 +476,8 @@ main (argc, argv)
modified_arg = quote_file_name (modified_arg);
if (need_cwd)
- used += strlen (cwd);
+ /* Overestimate in case we have to quote something in CWD. */
+ used += 2 * strlen (cwd);
used += strlen (modified_arg) + 1;
while (used + 2 > size_allocated)
{
@@ -487,7 +488,7 @@ main (argc, argv)
}
if (need_cwd)
- strcat (msgp->mtext, cwd);
+ strcat (msgp->mtext, quote_file_name (cwd));
strcat (msgp->mtext, modified_arg);
strcat (msgp->mtext, " ");