# HG changeset patch # User David A. Holland # Date 1292806296 18000 # Node ID 5045b9678bb074c7f435b6c87a5caf43d2816521 # Parent 120629a5d6bfa9f243d4af8877489d05b0608695 woops diff -r 120629a5d6bf -r 5045b9678bb0 main.c --- a/main.c Sun Dec 19 19:49:43 2010 -0500 +++ b/main.c Sun Dec 19 19:51:36 2010 -0500 @@ -912,7 +912,7 @@ if (argv[i][0] != '-') { break; } - place_setcommandline(&cmdplace, i); + place_setcommandline(&cmdplace, i, 1); if (check_flag_option(argv[i]+1)) { continue; } @@ -922,7 +922,7 @@ if (check_prefix_option(&cmdplace, argv[i]+1)) { continue; } - place_setcommandline(&cmdplace, i+1); + place_setcommandline(&cmdplace, i+1, 1); if (check_arg_option(argv[i]+1, &cmdplace, argv[i+1])) { i++; continue; diff -r 120629a5d6bf -r 5045b9678bb0 place.c --- a/place.c Sun Dec 19 19:49:43 2010 -0500 +++ b/place.c Sun Dec 19 19:51:36 2010 -0500 @@ -7,10 +7,6 @@ #include "array.h" #include "place.h" -#define NOWHERE_LINE 0 -#define BUILTIN_LINE 1 -#define COMMANDLINE_LINE 2 - struct placefile { struct place includedfrom; char *name; @@ -81,13 +77,23 @@ } void -place_setcommandline(struct place *p, unsigned column) +place_setcommandline(struct place *p, unsigned line, unsigned column) { + p->type = P_COMMANDLINE; p->file = NULL; - p->line = COMMANDLINE_LINE; + p->line = line; p->column = column; } +void +place_setfilestart(struct place *p, const struct placefile *pf) +{ + p->type = P_COMMANDLINE; + p->file = pf; + p->line = 1; + p->column = 1; +} + static const char * place_getname(const struct place *p) diff -r 120629a5d6bf -r 5045b9678bb0 place.h --- a/place.h Sun Dec 19 19:49:43 2010 -0500 +++ b/place.h Sun Dec 19 19:51:36 2010 -0500 @@ -17,7 +17,8 @@ void place_setnowhere(struct place *p); void place_setbuiltin(struct place *p, unsigned num); -void place_setcommandline(struct place *p, unsigned word); +void place_setcommandline(struct place *p, unsigned word, unsigned column); +void place_setfilestart(struct place *p, const struct placefile *pf); const struct placefile *place_addfile(const struct place *incplace, const char *name, bool fromsystemdir);