X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=config%2Fzconf.l;h=0e8b892ba68303899890321b9c02341e166a4bae;hb=5bcae0a92151f1b85a968fde1959011d940c8036;hp=5d9b060e88f7d2932de473840d333b147e9389a2;hpb=991f1fbe02ccfd2595908a03369621ab05cd21ff;p=carl9170fw.git diff --git a/config/zconf.l b/config/zconf.l index 5d9b060..0e8b892 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -52,7 +52,7 @@ static void append_string(const char *str, int size) if (new_size > text_asize) { new_size += START_STRSIZE - 1; new_size &= -START_STRSIZE; - text = realloc(text, new_size); + text = xrealloc(text, new_size); text_asize = new_size; } memcpy(text + text_size, str, size); @@ -328,20 +328,15 @@ 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()); - iter = current_file->parent; - while (iter && \ - strcmp(iter->name,current_file->name)) { - fprintf(stderr, " included from: '%s:%d'\n", - iter->name, iter->lineno-1); + "Recursive inclusion detected.\n" + "Inclusion path:\n" + " current file : %s\n", zconf_curname()); + iter = current_file; + do { iter = iter->parent; - } - if (iter) - fprintf(stderr, " included from: '%s:%d'\n", - iter->name, iter->lineno+1); + fprintf(stderr, " included from: %s:%d\n", + iter->name, iter->lineno - 1); + } while (strcmp(iter->name, current_file->name)); exit(1); } }