Prevent illegal envvars causing bash syntax errors
This commit is contained in:
parent
85b5103cd9
commit
050ac73789
1 changed files with 2 additions and 3 deletions
|
@ -175,14 +175,13 @@ COMMAND, and passes ARGS to it."
|
|||
(coding-system-for-read 'utf-8))
|
||||
(with-temp-file post-script
|
||||
(insert "#!/usr/bin/env sh\n"
|
||||
"[ -x \"$0\" ] && rm -f \"$0\"\n"
|
||||
(save-match-data
|
||||
(cl-loop for env in process-environment
|
||||
if (string-match "^\\([^=]+\\)=\\(.+\\)$" env)
|
||||
if (string-match "^\\([^ !@#$%^&*()=]+\\)=\\(.+\\)$" env)
|
||||
concat (format "%s=%S\n"
|
||||
(match-string 1 env)
|
||||
(match-string 2 env))))
|
||||
"\n"
|
||||
"\n[ -x \"$0\" ] && rm -f \"$0\"\n"
|
||||
(if (stringp lines)
|
||||
lines
|
||||
(string-join
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue