srcpos: drop special handling of tab
Align column number with those reported by gcc. Thus, do not make a tab count as 8 spaces. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
parent
65893da4ae
commit
37dea76e97
5
srcpos.c
5
srcpos.c
|
@ -209,8 +209,6 @@ struct srcpos srcpos_empty = {
|
||||||
.file = NULL,
|
.file = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TAB_SIZE 8
|
|
||||||
|
|
||||||
void srcpos_update(struct srcpos *pos, const char *text, int len)
|
void srcpos_update(struct srcpos *pos, const char *text, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -224,9 +222,6 @@ void srcpos_update(struct srcpos *pos, const char *text, int len)
|
||||||
if (text[i] == '\n') {
|
if (text[i] == '\n') {
|
||||||
current_srcfile->lineno++;
|
current_srcfile->lineno++;
|
||||||
current_srcfile->colno = 1;
|
current_srcfile->colno = 1;
|
||||||
} else if (text[i] == '\t') {
|
|
||||||
current_srcfile->colno =
|
|
||||||
ALIGN(current_srcfile->colno, TAB_SIZE);
|
|
||||||
} else {
|
} else {
|
||||||
current_srcfile->colno++;
|
current_srcfile->colno++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue