catch unbalanced %endifs
authorroot <devnull@localhost>
Mon, 19 Feb 1996 21:16:15 +0000 (21:16 +0000)
committerroot <devnull@localhost>
Mon, 19 Feb 1996 21:16:15 +0000 (21:16 +0000)
CVS patchset: 324
CVS date: 1996/02/19 21:16:15

build/spec.c

index 0456eae..5eab526 100644 (file)
@@ -391,6 +391,9 @@ static int read_line(FILE *f, char *line)
            read_level->reading =
                read_level->next->reading && ! read_level->reading;
        } else if (! strncmp("%endif", line, 6)) {
+           if (! read_level) {
+               return RPMERR_UNMATCHEDIF;
+           }
            rl = read_level;
            read_level = rl->next;
            free(rl);