aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-02 17:43:32 +0000
committerRichard M. Stallman1996-09-02 17:43:32 +0000
commitf1db6a73ef6352c17393680e6d0b6980294aec68 (patch)
tree5114c0bed1abaada6ff05634d688c2644a46f232 /lib-src
parente5446a46ef6fff6cb342bfde2821f50ad71ad7b6 (diff)
downloademacs-f1db6a73ef6352c17393680e6d0b6980294aec68.tar.gz
emacs-f1db6a73ef6352c17393680e6d0b6980294aec68.zip
(quote_file_name): Quote with &, not \.
Quote `-' only at start of file name. Terminate the value string.
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 12c6b66040c..4d8037dea67 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -104,8 +104,8 @@ print_help_and_exit ()
104 exit (1); 104 exit (1);
105} 105}
106 106
107/* Return a copy of NAME, inserting a \ 107/* Return a copy of NAME, inserting a &
108 before each \, each -, and each space. 108 before each &, each space, and any initial -.
109 Change spaces to underscores, too, so that the 109 Change spaces to underscores, too, so that the
110 return value never contains a space. */ 110 return value never contains a space. */
111 111
@@ -122,17 +122,18 @@ quote_file_name (name)
122 { 122 {
123 if (*p == ' ') 123 if (*p == ' ')
124 { 124 {
125 *q++ = '\\'; 125 *q++ = '&';
126 *q++ = '_'; 126 *q++ = '_';
127 p++; 127 p++;
128 } 128 }
129 else 129 else
130 { 130 {
131 if (*p == '\\' || *p == '-') 131 if (*p == '&' || (*p == '-' && p == name))
132 *q++ = '\\'; 132 *q++ = '&';
133 *q++ = *p++; 133 *q++ = *p++;
134 } 134 }
135 } 135 }
136 *q++ = 0;
136 137
137 return copy; 138 return copy;
138} 139}