aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGeoff Voelker1998-09-07 23:39:23 +0000
committerGeoff Voelker1998-09-07 23:39:23 +0000
commit21a003b90ff24779c1faa0c620e496269c8f7074 (patch)
treeb9e9cf63a613f5947db93a23df76500162c676c1 /lisp
parent24c129e40e0693476967629f403406ef0476013a (diff)
downloademacs-21a003b90ff24779c1faa0c620e496269c8f7074.tar.gz
emacs-21a003b90ff24779c1faa0c620e496269c8f7074.zip
(comint-arguments): Ignore backslashes when using
w32 shells that expect backslashes as the directory separator.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/comint.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 42c2fb88308..563c6e7d770 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1180,18 +1180,23 @@ We assume whitespace separates arguments, except within quotes.
1180Also, a run of one or more of a single character 1180Also, a run of one or more of a single character
1181in `comint-delimiter-argument-list' is a separate argument. 1181in `comint-delimiter-argument-list' is a separate argument.
1182Argument 0 is the command name." 1182Argument 0 is the command name."
1183 ;; The first line handles ordinary characters and backslash-sequences. 1183 ;; The first line handles ordinary characters and backslash-sequences
1184 ;; (except with w32 msdos-like shells, where backslashes are valid).
1184 ;; The second matches "-quoted strings. 1185 ;; The second matches "-quoted strings.
1185 ;; The third matches '-quoted strings. 1186 ;; The third matches '-quoted strings.
1186 ;; The fourth matches `-quoted strings. 1187 ;; The fourth matches `-quoted strings.
1187 ;; This seems to fit the syntax of BASH 2.0. 1188 ;; This seems to fit the syntax of BASH 2.0.
1188 (let ((argpart "[^ \n\t\"'`\\]+\\|\\\\[\"'`\\]+\\|\ 1189 (let* ((first (if (and (eq system-type 'windows-nt)
1189\\(\"\\([^\"\\]\\|\\\\.\\)*\"\\|\ 1190 (w32-shell-dos-semantics))
1191 "[^ \n\t\"'`]+\\|"
1192 "[^ \n\t\"'`\\]+\\|\\\\[\"'`\\]+\\|"))
1193 (argpart (concat first
1194 "\\(\"\\([^\"\\]\\|\\\\.\\)*\"\\|\
1190'[^']*'\\|\ 1195'[^']*'\\|\
1191`[^`]*`\\)") 1196`[^`]*`\\)"))
1192 (args ()) (pos 0) 1197 (args ()) (pos 0)
1193 (count 0) 1198 (count 0)
1194 beg str value quotes) 1199 beg str value quotes)
1195 ;; Build a list of all the args until we have as many as we want. 1200 ;; Build a list of all the args until we have as many as we want.
1196 (while (and (or (null mth) (<= count mth)) 1201 (while (and (or (null mth) (<= count mth))
1197 (string-match argpart string pos)) 1202 (string-match argpart string pos))