mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fix problem parsing quoted commas in a manifest parameter
This commit is contained in:
parent
788db400fb
commit
77f6853877
@ -1616,6 +1616,7 @@ extract_manifest_args(const string &name, int num_args,
|
||||
c = get();
|
||||
}
|
||||
args.push_back(arg);
|
||||
|
||||
} else {
|
||||
// Skip paren.
|
||||
c = get();
|
||||
@ -1625,6 +1626,23 @@ extract_manifest_args(const string &name, int num_args,
|
||||
args.push_back(arg);
|
||||
arg = "";
|
||||
|
||||
} else if (c == '"' || c == '\'') {
|
||||
// Quoted string or character.
|
||||
int quote_mark = c;
|
||||
arg += c;
|
||||
c = get();
|
||||
while (c != EOF && c != quote_mark && c != '\n') {
|
||||
if (c == '\\') {
|
||||
arg += c;
|
||||
c = get();
|
||||
}
|
||||
if (c != EOF) {
|
||||
arg += c;
|
||||
c = get();
|
||||
}
|
||||
}
|
||||
arg += c;
|
||||
|
||||
} else if (c == '(') {
|
||||
// Nested parens.
|
||||
int paren_level = 1;
|
||||
@ -1723,6 +1741,21 @@ extract_manifest_args_inline(const string &name, int num_args,
|
||||
p++;
|
||||
}
|
||||
args.push_back(expr.substr(q, p - q));
|
||||
|
||||
} else if (expr[p] == '"' || expr[p] == '\'') {
|
||||
// Quoted string or character.
|
||||
int quote_mark = expr[p];
|
||||
p++;
|
||||
while (p < expr.size() && expr[p] != quote_mark && expr[p] != '\n') {
|
||||
if (expr[p] == '\\') {
|
||||
p++;
|
||||
}
|
||||
if (p < expr.size()) {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
|
||||
} else {
|
||||
// Skip paren.
|
||||
p++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user