From 7b59a5ce32de3a3adc2f557c30268e7f4e657ef0 Mon Sep 17 00:00:00 2001 From: "James K. Lowden" <jklowden@symas.com> Date: Wed, 8 Jan 2025 17:44:49 -0500 Subject: [PATCH] set column location correctly after newline --- gcc/cobol/scan_ante.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cobol/scan_ante.h b/gcc/cobol/scan_ante.h index bd12f7268d7a..605a4ac4308e 100644 --- a/gcc/cobol/scan_ante.h +++ b/gcc/cobol/scan_ante.h @@ -363,7 +363,7 @@ update_location() { size_t len = yyleng; if( n ) { char *p = static_cast<char*>(memrchr(yytext, '\n', yyleng)); - len = (yytext + yyleng) - p; + len = (yytext + yyleng) - ++p; } if( yylloc.last_line != yylineno ) { -- GitLab