diff options
| author | Geoff Voelker | 1998-09-07 23:39:23 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1998-09-07 23:39:23 +0000 |
| commit | 21a003b90ff24779c1faa0c620e496269c8f7074 (patch) | |
| tree | b9e9cf63a613f5947db93a23df76500162c676c1 /lisp | |
| parent | 24c129e40e0693476967629f403406ef0476013a (diff) | |
| download | emacs-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.el | 19 |
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. | |||
| 1180 | Also, a run of one or more of a single character | 1180 | Also, a run of one or more of a single character |
| 1181 | in `comint-delimiter-argument-list' is a separate argument. | 1181 | in `comint-delimiter-argument-list' is a separate argument. |
| 1182 | Argument 0 is the command name." | 1182 | Argument 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)) |