]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
erec: skip includes with INDESC_INTERNAL
authorPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 08:09:27 +0000 (08:09 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 08:12:01 +0000 (08:12 +0000)
Don't display "In file included from internal:0:0-0:" for errors occuring
in a parsed file.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/erec.c

index a157d2fa76dd3ab9e3b77e7182d4f2db8c1448cb..4930085f93c9bc4ee50f8a16f1084f2261fc58ad 100644 (file)
@@ -114,7 +114,9 @@ void erec_print(FILE *f, const struct error_record *erec)
                if (indesc->location.indesc != NULL) {
                        const char *prefix = "In file included from";
                        iloc = &indesc->location;
-                       for (tmp = iloc->indesc; tmp != NULL; tmp = iloc->indesc) {
+                       for (tmp = iloc->indesc;
+                            tmp != NULL && tmp->type != INDESC_INTERNAL;
+                            tmp = iloc->indesc) {
                                fprintf(f, "%s %s:%u:%u-%u:\n", prefix,
                                        tmp->name,
                                        iloc->first_line, iloc->first_column,