fix last known bug in computing columb numbers in error messages

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-04-28 15:33:05 +00:00
parent c1366df3d5
commit dad2812867
2 changed files with 77 additions and 69 deletions

View File

@@ -130,11 +130,13 @@ static void pbcwhere(const char *text, int *line, int *col )
int loc_col = *col;
char c;
while ( (c = *text++) ) {
if ( c == '\n' ) {
if ( c == '\t' ) {
loc_col += 8 - (loc_col % 8);
} else if ( c == '\n' ) {
loc_line++;
loc_col = 0;
}
loc_col++;
loc_col = 1;
} else
loc_col++;
}
*line = loc_line;
*col = loc_col;
@@ -157,10 +159,12 @@ static void pbcwhere(const char *text, int *line, int *col )
yylloc->last_line = my_lineno; \
yylloc->last_column = my_col - 1; \
} while (0)
#define STORE_LOC do { STORE_START; STORE_END } while (0)
#else
#define STORE_POS
#define STORE_START
#define STORE_END
#define STORE_LOC
#endif
%}