/*
* udev_rules_parse.c
*
- * Userspace devfs
- *
* Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2003-2005 Kay Sievers <kay.sievers@vrfy.org>
*
- *
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
char *temp;
linepos = *line;
- if (!linepos)
+ if (linepos == NULL && linepos[0] == '\0')
return -1;
/* skip whitespace */
linepos++;
/* get the key */
+ if (linepos[0] == '\0')
+ return -1;
*key = linepos;
+
while (1) {
linepos++;
if (linepos[0] == '\0')
/* skip whitespace after key */
while (isspace(linepos[0]))
linepos++;
+ if (linepos[0] == '\0')
+ return -1;
/* get operation type */
if (linepos[0] == '=' && linepos[1] == '=') {
/* skip whitespace after operator */
while (isspace(linepos[0]))
linepos++;
+ if (linepos[0] == '\0')
+ return -1;
/* get the value*/
if (linepos[0] == '"')
list_for_each_entry_safe(name_loop, name_tmp, &name_list, node) {
parse_file(rules, name_loop->name);
list_del(&name_loop->node);
+ free(name_loop);
}
}