Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c1c74b43
Commit
c1c74b43
authored
Jul 01, 1995
by
Richard M. Stallman
Browse files
(shell-quote-argument): Don't do anything, on MS-DOS.
parent
b95c8e7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
lisp/subr.el
lisp/subr.el
+14
-11
No files found.
lisp/subr.el
View file @
c1c74b43
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment