Changeset 3465

Show
Ignore:
Timestamp:
08/09/07 17:12:02 (1 year ago)
Author:
tg
Message:

add filename to syntax error messages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/common-nfo/tools/nfotiser/nfotiser.h

    r3461 r3465  
    6262void parser_dump(struct parser_res *, const struct parser_keywords *); 
    6363void parser_free(struct parser_result *); 
     64EXTERN char *parser_errpfx I__(NULL); 
    6465__END_DECLS 
    6566 
  • branches/common-nfo/tools/nfotiser/parser.c

    r3464 r3465  
    361361        va_start(args, fmt); 
    362362        fflush(NULL); 
    363         fprintf(stderr, "syntax error [%4zu]: ", lno); 
     363        fprintf(stderr, "syntax error [%s%s%4zu]: ", 
     364            parser_errpfx ? parser_errpfx : "", 
     365            parser_errpfx ? ":" : "", lno); 
    364366        fflush(NULL); 
    365367        verrx(1, fmt, args); 
  • branches/common-nfo/tools/nfotiser/pfile.c

    r3463 r3465  
    129129                err(255, "cannot open input file '%s'", fn); 
    130130        printf("parsing %s…", fn); 
     131        if (parser_errpfx != NULL) 
     132                free(parser_errpfx); 
     133        parser_errpfx = strdup(fn); 
    131134        parsed = nfo_parse(fd, kwords); 
     135        free(parser_errpfx); 
     136        parser_errpfx = NULL; 
    132137        close(fd); 
    133138        if (CIRCLEQ_EMPTY(parsed))