diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-07-01 21:48:13 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-07-01 21:48:13 +0000 |
commit | 22380e26c8d5f1c637b7470398f00d1b985f758c (patch) | |
tree | f33a401dd61941088fcedfc6297a4fc6e55d2933 /lisp/subr.el | |
parent | 8f990177faa5cf6e4fe6117dda5dbbe3d5517fef (diff) | |
download | emacs-22380e26c8d5f1c637b7470398f00d1b985f758c.tar.gz |
(shell-quote-argument): Don't do anything, on MS-DOS.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 2c0ebd7617b..c9239673c19 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -864,17 +864,20 @@ STRING should be given if the last search was by `string-match' on STRING." (defun shell-quote-argument (argument) "Quote an argument for passing as argument to an inferior shell." - ;; Quote everything except POSIX filename characters. - ;; This should be safe enough even for really weird shells. - (if (eq system-type 'windows-nt) - (concat "\"" argument "\"") - (let ((result "") (start 0) end) - (while (string-match "[^-0-9a-zA-Z_./]" argument start) - (setq end (match-beginning 0) - result (concat result (substring argument start end) - "\\" (substring argument end (1+ end))) - start (1+ end))) - (concat result (substring argument start))))) + (if (eq system-type 'ms-dos) + ;; MS-DOS shells don't have quoting, so don't do any. + argument + (if (eq system-type 'windows-nt) + (concat "\"" argument "\"") + ;; Quote everything except POSIX filename characters. + ;; This should be safe enough even for really weird shells. + (let ((result "") (start 0) end) + (while (string-match "[^-0-9a-zA-Z_./]" argument start) + (setq end (match-beginning 0) + result (concat result (substring argument start end) + "\\" (substring argument end (1+ end))) + start (1+ end))) + (concat result (substring argument start)))))) (defun make-syntax-table (&optional oldtable) "Return a new syntax table. |