X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=namedev_parse.c;h=22e3523f3d8b67c474d245a15359f2d1e2157993;hb=f156b6d2037ff09f7218e11d5326c05488356ea1;hp=4bb1a97ce9eb05bc3b8455f33f46b18e41a48b5d;hpb=3e4414508b409a21b023b9ca4532f62003e0db97;p=elogind.git diff --git a/namedev_parse.c b/namedev_parse.c index 4bb1a97ce..22e3523f3 100644 --- a/namedev_parse.c +++ b/namedev_parse.c @@ -182,15 +182,13 @@ static int namedev_parse_rules(char *filename) continue; } - /* empty line? */ - if (bufline[0] == '\0' || bufline[0] == '\n') - continue; - /* eat the whitespace */ - while (isspace(bufline[0])) { + while ((count > 0) && isspace(bufline[0])) { bufline++; count--; } + if (count == 0) + continue; /* see if this is a comment */ if (bufline[0] == COMMENT_CHARACTER) @@ -381,15 +379,13 @@ static int namedev_parse_permissions(char *filename) continue; } - /* empty line? */ - if (bufline[0] == '\0' || bufline[0] == '\n') - continue; - /* eat the whitespace */ - while (isspace(bufline[0])) { + while ((count > 0) && isspace(bufline[0])) { bufline++; count--; } + if (count == 0) + continue; /* see if this is a comment */ if (bufline[0] == COMMENT_CHARACTER) @@ -445,7 +441,7 @@ exit: return retval; } -int namedev_init_rules() +int namedev_init_rules(void) { struct stat stats; @@ -457,7 +453,7 @@ int namedev_init_rules() udev_rules_filename, RULEFILE_SUFFIX); } -int namedev_init_permissions() +int namedev_init_permissions(void) { struct stat stats;