diff options
author | edwardsp <mail@edwardsp.co.uk> | 2022-05-24 16:26:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 08:26:07 -0700 |
commit | ba701a7cf8c60a85a317dcde63083fc76061c7d6 (patch) | |
tree | 0b392041c7fc37182cbefeebccfcd96e8016e4fc | |
parent | 557845cccc0523c34072dbeddf6035f54fb2a76e (diff) | |
download | spack-ba701a7cf8c60a85a317dcde63083fc76061c7d6.tar.gz spack-ba701a7cf8c60a85a317dcde63083fc76061c7d6.tar.bz2 spack-ba701a7cf8c60a85a317dcde63083fc76061c7d6.tar.xz spack-ba701a7cf8c60a85a317dcde63083fc76061c7d6.zip |
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)))"
-rw-r--r-- | lib/spack/spack/util/executable.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 3457ea9bff..c424b9cdb5 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -178,7 +178,7 @@ class Executable(object): 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" |