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
+16 -4
View File
@@ -942,11 +942,23 @@ BPackageInfo::Parser::_IsValidResolvableName(const char* string,
int32* _errorPos)
{
for (const char* c = string; *c != '\0'; c++) {
if (*c == '-' || *c == '/' || isspace(*c)) {
if (_errorPos != NULL)
*_errorPos = c - string;
return false;
switch (*c) {
case '-':
case '/':
case '<':
case '>':
case '=':
case '!':
break;
default:
if (!isspace(*c))
continue;
break;
}
if (_errorPos != NULL)
*_errorPos = c - string;
return false;
}
return true;
}