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) 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;
} }