chiark / gitweb /
fix whitespace
[elogind.git] / udev / udev-rules.c
index da08bc11f69668a807e675743757da033fc76dee..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;
@@ -1568,6 +1568,7 @@ invalid:
 static int parse_file(struct udev_rules *rules, const char *filename, unsigned short filename_off)
 {
        FILE *f;
+       unsigned int first_token;
        char line[UTIL_LINE_SIZE];
        int line_nr = 0;
        unsigned int i;
@@ -1577,6 +1578,9 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
        f = fopen(filename, "r");
        if (f == NULL)
                return -1;
+
+       first_token = rules->token_cur;
+
        while (fgets(line, sizeof(line), f) != NULL) {
                char *key;
                size_t len;
@@ -1614,7 +1618,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
        fclose(f);
 
        /* link GOTOs to LABEL rules in this file to be able to fast-forward */
-       for (i = rules->token_cur+1; i < rules->token_cur; i++) {
+       for (i = first_token+1; i < rules->token_cur; i++) {
                if (rules->tokens[i].type == TK_A_GOTO) {
                        char *label = &rules->buf[rules->tokens[i].key.value_off];
                        unsigned int j;
@@ -2202,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 {