aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-07-01 21:48:13 +0000
committerRichard M. Stallman1995-07-01 21:48:13 +0000
commitc1c74b432075dd686aa6351440ea23bc0e0c525e (patch)
tree1572069645e548373ff5e4078d515a34ff132763
parentb95c8e7e3efc3f426800fca847f461b373a99153 (diff)
downloademacs-c1c74b432075dd686aa6351440ea23bc0e0c525e.tar.gz
emacs-c1c74b432075dd686aa6351440ea23bc0e0c525e.zip
(shell-quote-argument): Don't do anything, on MS-DOS.
-rw-r--r--lisp/subr.el25
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."
864 864
865(defun shell-quote-argument (argument) 865(defun shell-quote-argument (argument)
866 "Quote an argument for passing as argument to an inferior shell." 866 "Quote an argument for passing as argument to an inferior shell."
867 ;; Quote everything except POSIX filename characters. 867 (if (eq system-type 'ms-dos)
868 ;; This should be safe enough even for really weird shells. 868 ;; MS-DOS shells don't have quoting, so don't do any.
869 (if (eq system-type 'windows-nt) 869 argument
870 (concat "\"" argument "\"") 870 (if (eq system-type 'windows-nt)
871 (let ((result "") (start 0) end) 871 (concat "\"" argument "\"")
872 (while (string-match "[^-0-9a-zA-Z_./]" argument start) 872 ;; Quote everything except POSIX filename characters.
873 (setq end (match-beginning 0) 873 ;; This should be safe enough even for really weird shells.
874 result (concat result (substring argument start end) 874 (let ((result "") (start 0) end)
875 "\\" (substring argument end (1+ end))) 875 (while (string-match "[^-0-9a-zA-Z_./]" argument start)
876 start (1+ end))) 876 (setq end (match-beginning 0)
877 (concat result (substring argument start))))) 877 result (concat result (substring argument start end)
878 "\\" (substring argument end (1+ end)))
879 start (1+ end)))
880 (concat result (substring argument start))))))
878 881
879(defun make-syntax-table (&optional oldtable) 882(defun make-syntax-table (&optional oldtable)
880 "Return a new syntax table. 883 "Return a new syntax table.