mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Prevent illegal envvars causing bash syntax errors
This commit is contained in:
@ -175,14 +175,13 @@ COMMAND, and passes ARGS to it."
|
|||||||
(coding-system-for-read 'utf-8))
|
(coding-system-for-read 'utf-8))
|
||||||
(with-temp-file post-script
|
(with-temp-file post-script
|
||||||
(insert "#!/usr/bin/env sh\n"
|
(insert "#!/usr/bin/env sh\n"
|
||||||
"[ -x \"$0\" ] && rm -f \"$0\"\n"
|
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(cl-loop for env in process-environment
|
(cl-loop for env in process-environment
|
||||||
if (string-match "^\\([^=]+\\)=\\(.+\\)$" env)
|
if (string-match "^\\([^ !@#$%^&*()=]+\\)=\\(.+\\)$" env)
|
||||||
concat (format "%s=%S\n"
|
concat (format "%s=%S\n"
|
||||||
(match-string 1 env)
|
(match-string 1 env)
|
||||||
(match-string 2 env))))
|
(match-string 2 env))))
|
||||||
"\n"
|
"\n[ -x \"$0\" ] && rm -f \"$0\"\n"
|
||||||
(if (stringp lines)
|
(if (stringp lines)
|
||||||
lines
|
lines
|
||||||
(string-join
|
(string-join
|
||||||
|
Reference in New Issue
Block a user