BPackageInfo::Parser: Be a bit stricter wrt. names after all
Also disallow the operator characters in names.
This commit is contained in:
@@ -942,11 +942,23 @@ BPackageInfo::Parser::_IsValidResolvableName(const char* string,
|
|||||||
int32* _errorPos)
|
int32* _errorPos)
|
||||||
{
|
{
|
||||||
for (const char* c = string; *c != '\0'; c++) {
|
for (const char* c = string; *c != '\0'; c++) {
|
||||||
if (*c == '-' || *c == '/' || isspace(*c)) {
|
switch (*c) {
|
||||||
if (_errorPos != NULL)
|
case '-':
|
||||||
*_errorPos = c - string;
|
case '/':
|
||||||
return false;
|
case '<':
|
||||||
|
case '>':
|
||||||
|
case '=':
|
||||||
|
case '!':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!isspace(*c))
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_errorPos != NULL)
|
||||||
|
*_errorPos = c - string;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user