chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] add dumb script to show all sysfs devices in the system.
[elogind.git]
/
namedev_parse.c
diff --git
a/namedev_parse.c
b/namedev_parse.c
index 4bb1a97ce9eb05bc3b8455f33f46b18e41a48b5d..22e3523f3d8b67c474d245a15359f2d1e2157993 100644
(file)
--- a/
namedev_parse.c
+++ b/
namedev_parse.c
@@
-182,15
+182,13
@@
static int namedev_parse_rules(char *filename)
continue;
}
continue;
}
- /* empty line? */
- if (bufline[0] == '\0' || bufline[0] == '\n')
- continue;
-
/* eat the whitespace */
/* eat the whitespace */
- while (isspace(bufline[0])) {
+ while (
(count > 0) &&
isspace(bufline[0])) {
bufline++;
count--;
}
bufline++;
count--;
}
+ if (count == 0)
+ continue;
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
@@
-381,15
+379,13
@@
static int namedev_parse_permissions(char *filename)
continue;
}
continue;
}
- /* empty line? */
- if (bufline[0] == '\0' || bufline[0] == '\n')
- continue;
-
/* eat the whitespace */
/* eat the whitespace */
- while (isspace(bufline[0])) {
+ while (
(count > 0) &&
isspace(bufline[0])) {
bufline++;
count--;
}
bufline++;
count--;
}
+ if (count == 0)
+ continue;
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
@@
-445,7
+441,7
@@
exit:
return retval;
}
return retval;
}
-int namedev_init_rules()
+int namedev_init_rules(
void
)
{
struct stat stats;
{
struct stat stats;
@@
-457,7
+453,7
@@
int namedev_init_rules()
udev_rules_filename, RULEFILE_SUFFIX);
}
udev_rules_filename, RULEFILE_SUFFIX);
}
-int namedev_init_permissions()
+int namedev_init_permissions(
void
)
{
struct stat stats;
{
struct stat stats;