Update regex to correctly identify quoted args (#23494)
Previously the regex was only checking for presence of quotes as a beginning or end character and not a matching set. This erroneously identified the following *single* argument as being quoted: source bashenvfile &> /dev/null && python3 -c "import os, json; print(json.dumps(dict(os.environ)))"
This commit is contained in:
parent
557845cccc
commit
ba701a7cf8
1 changed files with 1 additions and 1 deletions
|
@ -178,7 +178,7 @@ def streamify(arg, mode):
|
|||
istream, close_istream = streamify(input, 'r')
|
||||
|
||||
if not ignore_quotes:
|
||||
quoted_args = [arg for arg in args if re.search(r'^"|^\'|"$|\'$', arg)]
|
||||
quoted_args = [arg for arg in args if re.search(r'^".*"$|^\'.*\'$', arg)]
|
||||
if quoted_args:
|
||||
tty.warn(
|
||||
"Quotes in command arguments can confuse scripts like"
|
||||
|
|
Loading…
Reference in a new issue