X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fconf-input.c;h=0272de21eb27722c68a1704cdb862d80640136c3;hb=ddffc1e06a78085524bec742aef746c2cc5bd131;hp=37147a8de336b8eff886f5a1a21354ff92f85980;hpb=47a0795e8a28e8ad6ff55cda89e300267d9e590c;p=libucw.git diff --git a/lib/conf-input.c b/lib/conf-input.c index 37147a8d..0272de21 100644 --- a/lib/conf-input.c +++ b/lib/conf-input.c @@ -159,7 +159,7 @@ get_token(uns is_command_name, byte **msg) return NULL; } if (!*line || *line == '#') - log(L_WARN, "The line %s:%d following a backslash is empty", name_parse_fb, line_num); + log(L_WARN, "The line %s:%d following a backslash is empty", name_parse_fb ? : (byte*) "", line_num); } else { split_grow(&word_buf, words+1); uns start = copied; @@ -270,7 +270,12 @@ parse_fastbuf(byte *name_fb, struct fastbuf *fb, uns depth) goto error; } error: - log(L_ERROR, "File %s, line %d: %s", name_fb, line_num, msg); + if (name_fb) + log(L_ERROR, "File %s, line %d: %s", name_fb, line_num, msg); + else if (line_num == 1) + log(L_ERROR, "Manual setting of configuration: %s", msg); + else + log(L_ERROR, "Manual setting of configuration, line %d: %s", line_num, msg); return "included from here"; } @@ -317,7 +322,7 @@ load_string(byte *string) cf_init_stack(); struct fastbuf fb; fbbuf_init_read(&fb, string, strlen(string), 0); - byte *msg = parse_fastbuf("memory string", &fb, 0); + byte *msg = parse_fastbuf(NULL, &fb, 0); return !!msg || done_stack(); }