Fix $() handling, broken since the beginning at r108014.
Due to off-by-one error in brackets counting it consumed the rest of the string, preventing later variables expansions. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
This commit is contained in:
parent
c3eda7cbf1
commit
de57976691
@ -681,15 +681,15 @@ config::expand_one(const char *&src, string &dst, bool is_shell)
|
||||
// This is the escape hatch for passing down shell subcommands
|
||||
if (*src == '(') {
|
||||
dst += '$';
|
||||
count = 1;
|
||||
count = 0;
|
||||
/* If the string ends before ) is matched , return. */
|
||||
while (count > 0 && *src) {
|
||||
do {
|
||||
if (*src == ')')
|
||||
count--;
|
||||
else if (*src == '(')
|
||||
count++;
|
||||
dst += *src++;
|
||||
}
|
||||
} while (count > 0 && *src);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user