From ff6c1cb139336915dd0d0a3092bc65cecc2bc75f Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 5 Oct 2008 17:27:21 +0200 Subject: [PATCH] don not print error if GOTO jumps just to next rule --- udev/udev_rules_parse.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/udev/udev_rules_parse.c b/udev/udev_rules_parse.c index 5a9552ff..c42bd08c 100644 --- a/udev/udev_rules_parse.c +++ b/udev/udev_rules_parse.c @@ -79,8 +79,8 @@ static size_t find_label(const struct udev_rules_iter *iter, const char *label) next: dbg(rules->udev, "current=%zi\n", current); if (current >= rules->bufsize) { - err(rules->udev, "LABEL='%s' not found, GOTO will be ignored\n", label); - return iter->current; + dbg(rules->udev, "LABEL='%s' not found\n", label); + return 0; } rule = (struct udev_rule *) (rules->buf + current); @@ -747,9 +747,10 @@ static int parse_file(struct udev_rules *rules, const char *filename) dbg(rules->udev, "resolving goto label '%s'\n", goto_label); rule->goto_rule_off = find_label(&iter, goto_label); - if (rule->goto_rule_off == iter.current) { - err(rules->udev, "goto nonexistent label '%s' in '%s'\n", + if (rule->goto_rule_off == 0) { + err(rules->udev, "ignore goto to nonexistent label '%s' in '%s'\n", goto_label, filename); + rule->goto_rule_off = iter.current; } } } -- 2.39.5