pakfire_parser_set_namespace($$, $1);
- char* key;
- char* value;
+ char* key = NULL;
+ char* value = NULL;
int r = pakfire_string_partition($1, ":", &key, &value);
if (r == 0) {
- if (strcmp("package", key) == 0) {
+ if (key && strcmp("package", key) == 0) {
pakfire_parser_set($$, NULL, "name", value, 0);
}
}
| subparser_name T_EOL
{
- char* key;
- char* value;
+ char* key = NULL;
+ char* value = NULL;
// Create a new parser
$$ = pakfire_parser_create(pakfire, *parser, NULL, 0);
ABORT;
// Handle packages
- if (strcmp("package", key) == 0) {
+ if (key && strcmp("package", key) == 0) {
pakfire_parser_set_namespace($$, $1);
// Set the name (because we cannot have empty parsers)