> Date: Fri, 15 Dec 2006 11:31:18 +0100 > From: "Juanma Barranquero" <[EMAIL PROTECTED]> > Cc: emacs-pretest-bug@gnu.org, Emacs Devel <emacs-devel@gnu.org> > > > I execute all the following commands from a cmd command > > prompt (outside of Emacs). > > > > emacsclient -n -a runemacs "TO DO.txt" > > > > works correctly if Emacs IS already running, but if it is not > > already running then Emacs does not see the filename correctly; > > the quotes do not appear to be passed on to runemacs. > > The following patch addresses the issue by allocating quoted copies of > any argument containing spaces before calling execvp. > > Any objections to install this fix? As it stands, it affects also > non-Windows builds. Is requoting args the right behavior in these > environments?
Quoting arguments passed to execvp is _definitely_ the wrong thing for Posix platforms. The fact that we need to do that for Windows is due to the broken implementation of exec* routines in the Microsoft libraries: they concatenate the arguments together without quoting special characters, and pass the result to CreateProcess, with predictably bad results. By contrast, Posix execvp passes the arguments directly into the argv[] array of the child process. So please make this change conditioned on WINDOWSNT. Actually, a cleaner way of fixing this would be to have a WINDOWSNT-only wrapper for execvp, called, say w32_execvp, that does TRT with quoting the arguments. Then you could say #ifdef WINDOWSNT #define execvp w32_execvp #endif in emacsclient.c, and leave the mainline code intact. _______________________________________________ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug