mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
The line number needs to be updated only after the \n is processed by
the parser, so store a flag and update it next time around. Also each new line needs its own shared data.
This commit is contained in:
@ -58,6 +58,7 @@ struct cmd_parse_state {
|
||||
size_t len;
|
||||
size_t off;
|
||||
|
||||
int eol;
|
||||
int eof;
|
||||
struct cmd_parse_input *input;
|
||||
u_int escapes;
|
||||
@ -933,6 +934,10 @@ yylex(void)
|
||||
char *token, *cp;
|
||||
int ch, next;
|
||||
|
||||
if (ps->eol)
|
||||
ps->input->line++;
|
||||
ps->eol = 0;
|
||||
|
||||
for (;;) {
|
||||
ch = yylex_getc();
|
||||
|
||||
@ -959,7 +964,7 @@ yylex(void)
|
||||
/*
|
||||
* End of line. Update the line number.
|
||||
*/
|
||||
ps->input->line++;
|
||||
ps->eol = 1;
|
||||
return ('\n');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user