# HG changeset patch # User Richard M. Stallman # Date 841686212 0 # Node ID 25cfff7ffced08ac12ad04a5a212373dd0edf250 # Parent 9aa821b11ac19691d9a49e4a235661772320ce9e (quote_file_name): Quote with &, not \. Quote `-' only at start of file name. Terminate the value string. diff -r 9aa821b11ac1 -r 25cfff7ffced lib-src/emacsclient.c --- a/lib-src/emacsclient.c Mon Sep 02 17:28:10 1996 +0000 +++ b/lib-src/emacsclient.c Mon Sep 02 17:43:32 1996 +0000 @@ -104,8 +104,8 @@ exit (1); } -/* Return a copy of NAME, inserting a \ - before each \, each -, and each space. +/* Return a copy of NAME, inserting a & + before each &, each space, and any initial -. Change spaces to underscores, too, so that the return value never contains a space. */ @@ -122,17 +122,18 @@ { if (*p == ' ') { - *q++ = '\\'; + *q++ = '&'; *q++ = '_'; p++; } else { - if (*p == '\\' || *p == '-') - *q++ = '\\'; + if (*p == '&' || (*p == '-' && p == name)) + *q++ = '&'; *q++ = *p++; } } + *q++ = 0; return copy; }