Escape more characters when quoting for the command line

Inserting the compile command for vers_id.cpp into a compilation
database does not quote a string with embedded whitespace, although this
string is correctly quoted when used to invoke a shell.  Remove
whitespace from the character whitelist, so that it is always escaped.
This commit is contained in:
Kp 2019-12-17 05:01:38 +00:00
parent b037cd556f
commit 065bcb3da8

View file

@ -4163,7 +4163,7 @@ class DXXCommon(LazyObjectConstructor):
prior = False
for c in f(s):
# No xdigit support in str
if c in ' ()*+,-./:=[]_' or (c.isalnum() and not (prior and (c.isdigit() or c in 'abcdefABCDEF'))):
if c in '+,-./:=_' or (c.isalnum() and not (prior and (c.isdigit() or c in 'abcdefABCDEF'))):
r += c
elif c == '\n':
r += r'\n'