From: Masahiro Yamada Date: Thu, 22 Mar 2018 17:00:12 +0000 (+0900) Subject: kconfig: remove duplicated file name and lineno of recursive inclusion X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5bcae0a92151f1b85a968fde1959011d940c8036;p=carl9170fw.git kconfig: remove duplicated file name and lineno of recursive inclusion As in the unit test, the error message for the recursive inclusion looks like this: Kconfig.inc1:4: recursive inclusion detected. Inclusion path: current file : 'Kconfig.inc1' included from: 'Kconfig.inc3:1' included from: 'Kconfig.inc2:3' included from: 'Kconfig.inc1:4' The 'Kconfig.inc1:4' is duplicated in the first and last lines. Also, the single quotes do not help readability. Change the message like follows: Recursive inclusion detected. Inclusion path: current file : Kconfig.inc1 included from: Kconfig.inc3:1 included from: Kconfig.inc2:3 included from: Kconfig.inc1:4 Signed-off-by: Masahiro Yamada Signed-off-by: Christian Lamparter --- diff --git a/config/zconf.l b/config/zconf.l index cb49579..0e8b892 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -328,14 +328,13 @@ void zconf_nextfile(const char *name) for (iter = current_file->parent; iter; iter = iter->parent ) { if (!strcmp(current_file->name,iter->name) ) { fprintf(stderr, - "%s:%d: recursive inclusion detected. " - "Inclusion path:\n current file : '%s'\n", - zconf_curname(), zconf_lineno(), - zconf_curname()); + "Recursive inclusion detected.\n" + "Inclusion path:\n" + " current file : %s\n", zconf_curname()); iter = current_file; do { iter = iter->parent; - fprintf(stderr, " included from: '%s:%d'\n", + fprintf(stderr, " included from: %s:%d\n", iter->name, iter->lineno - 1); } while (strcmp(iter->name, current_file->name)); exit(1);