Add file names and line numbers to debug messages

MFC after:	3 days
This commit is contained in:
Stefan Eßer 2020-10-31 13:55:10 +00:00
parent 1462201cd5
commit 6688708624
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367204

View File

@ -448,7 +448,8 @@ cal_parse(FILE *in, FILE *out)
if (count < 0) {
/* Show error status based on return value */
if (debug)
fprintf(stderr, "Ignored: %s\n", buf);
fprintf(stderr, "Ignored: \"%s\" in %s/%s/%s line %d\n",
buf, cal_home, cal_dir, cal_file, cal_line);
if (count == -1)
continue;
count = -count + 1;
@ -468,7 +469,8 @@ cal_parse(FILE *in, FILE *out)
(void)strftime(dbuf, sizeof(dbuf),
d_first ? "%e %b" : "%b %e", &tm);
if (debug)
fprintf(stderr, "got %s\n", pp);
fprintf(stderr, "got \"%s\" in %s/%s/%s line %d\n",
pp, cal_home, cal_dir, cal_file, cal_line);
events[i] = event_add(year[i], month[i], day[i], dbuf,
((flags &= F_VARIABLE) != 0) ? 1 : 0, pp,
extradata[i]);