BPackageInfo::Parser: Be a bit stricter wrt. names after all

Also disallow the operator characters in names.
This commit is contained in:
Ingo Weinhold
2013-04-19 16:21:42 +02:00
parent 00b5554e11
commit 3c6784e95c
+14 -2
View File
@@ -942,12 +942,24 @@ 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) {
case '-':
case '/':
case '<':
case '>':
case '=':
case '!':
break;
default:
if (!isspace(*c))
continue;
break;
}
if (_errorPos != NULL) if (_errorPos != NULL)
*_errorPos = c - string; *_errorPos = c - string;
return false; return false;
} }
}
return true; return true;
} }