chiark / gitweb /
fix whitespace
[elogind.git] / udev / udev-rules.c
index 96645e8f02ec6b1f82d4d5e06325bd23e4fb793d..bc224040d215bce342aefb8a9840efe9a17c276e 100644 (file)
@@ -749,7 +749,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p
        char *line;
 
        envp = udev_device_get_properties_envp(dev);
-       if (util_run_program(udev, program, envp, result, sizeof(result), &reslen) != 0)
+       if (util_run_program(udev, program, envp, result, sizeof(result), &reslen, NULL) != 0)
                return -1;
 
        line = result;
@@ -1581,7 +1581,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
 
        first_token = rules->token_cur;
 
-       while(fgets(line, sizeof(line), f) != NULL) {
+       while (fgets(line, sizeof(line), f) != NULL) {
                char *key;
                size_t len;
 
@@ -1603,6 +1603,8 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
                while (line[len-2] == '\\') {
                        if (fgets(&line[len-2], (sizeof(line)-len)+2, f) == NULL)
                                break;
+                       if (strlen(&line[len-2]) < 2)
+                               break;
                        line_nr++;
                        len = strlen(line);
                }
@@ -2204,7 +2206,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                     program,
                                     &rules->buf[rule->rule.filename_off],
                                     rule->rule.filename_line);
-                               if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL) != 0) {
+                               if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL, NULL) != 0) {
                                        if (cur->key.op != OP_NOMATCH)
                                                goto nomatch;
                                } else {