diff options
-rw-r--r-- | src/scanner.l | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/scanner.l b/src/scanner.l index 6f1a5512..cb2ea320 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -639,16 +639,15 @@ int scanner_include_file(void *scanner, const char *filename, if (f != NULL) break; } - } - if (f == NULL) { + } else { f = fopen(filename, "r"); - if (f == NULL) { - erec = error(loc, "Could not open file \"%s\": %s\n", - filename, strerror(errno)); - goto err; - } name = filename; } + if (f == NULL) { + erec = error(loc, "Could not open file \"%s\": %s\n", + filename, strerror(errno)); + goto err; + } erec = scanner_push_file(scanner, name, f, loc); if (erec != NULL) |