GNU bug report logs - #18745
24.3; MS Windows, `call-process-shell-command' fails on `shell-quote-argument'ed bat file with quoted args

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> users.sourceforge.net>

Date: Thu, 16 Oct 2014 04:35:01 UTC

Severity: minor

Found in versions 25.0.50, 24.3

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 18745 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 18745 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#18745: 24.3; MS Windows, `call-process-shell-command' fails on
 `shell-quote-argument'ed bat file with quoted args
Date: Thu, 16 Oct 2014 16:15:28 -0400
>   (call-process-shell-command
>    "cmd.exe" nil t t
>    "/c \"c:/path with space/foo-bar.bat\" \"x y\"")

A few things to note:

- The "rest" arguments to call-process-shell-command are deprecated.
  I.e. you should use

    (call-process-shell-command
     "cmd.exe /c \"c:/path with space/foo-bar.bat\" \"x y\"" nil t t)

  instead (which is equivalent anyway, and I think it's more honest
  since it doesn't make it seem like those rest args are correctly
  separated).

- Why not use call-process instead (since you don't actually use the
  "shell-command" part, really)?
  Something like either

    (call-process "cmd.exe" nil t t
                  "/c" "\"c:/path with space/foo-bar.bat\" \"x y\"")
  or
    (call-process "c:/path with space/foo-bar.bat" nil t t "x" "y")


        Stefan




This bug report was last modified 9 years and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.