mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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();
|
c = get();
|
||||||
}
|
}
|
||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Skip paren.
|
// Skip paren.
|
||||||
c = get();
|
c = get();
|
||||||
@ -1625,6 +1626,23 @@ extract_manifest_args(const string &name, int num_args,
|
|||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
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 == '(') {
|
} else if (c == '(') {
|
||||||
// Nested parens.
|
// Nested parens.
|
||||||
int paren_level = 1;
|
int paren_level = 1;
|
||||||
@ -1723,6 +1741,21 @@ extract_manifest_args_inline(const string &name, int num_args,
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
args.push_back(expr.substr(q, p - q));
|
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 {
|
} else {
|
||||||
// Skip paren.
|
// Skip paren.
|
||||||
p++;
|
p++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user