mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 19:58:48 +00:00
Make a little effort to treate CRLF as LF in config files. GitHub issue
3720.
This commit is contained in:
parent
b88130d24b
commit
4008e2ff6d
17
cmd-parse.y
17
cmd-parse.y
@ -1273,6 +1273,16 @@ yylex(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ch == '\r') {
|
||||||
|
/*
|
||||||
|
* Treat \r\n as \n.
|
||||||
|
*/
|
||||||
|
ch = yylex_getc();
|
||||||
|
if (ch != '\n') {
|
||||||
|
yylex_ungetc(ch);
|
||||||
|
ch = '\r';
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ch == '\n') {
|
if (ch == '\n') {
|
||||||
/*
|
/*
|
||||||
* End of line. Update the line number.
|
* End of line. Update the line number.
|
||||||
@ -1619,6 +1629,13 @@ yylex_token(int ch)
|
|||||||
log_debug("%s: end at EOF", __func__);
|
log_debug("%s: end at EOF", __func__);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (state == NONE && ch == '\r') {
|
||||||
|
ch = yylex_getc();
|
||||||
|
if (ch != '\n') {
|
||||||
|
yylex_ungetc(ch);
|
||||||
|
ch = '\r';
|
||||||
|
}
|
||||||
|
}
|
||||||
if (state == NONE && ch == '\n') {
|
if (state == NONE && ch == '\n') {
|
||||||
log_debug("%s: end at EOL", __func__);
|
log_debug("%s: end at EOL", __func__);
|
||||||
break;
|
break;
|
||||||
|
1
tty.c
1
tty.c
@ -2656,7 +2656,6 @@ static void
|
|||||||
tty_colours(struct tty *tty, const struct grid_cell *gc)
|
tty_colours(struct tty *tty, const struct grid_cell *gc)
|
||||||
{
|
{
|
||||||
struct grid_cell *tc = &tty->cell;
|
struct grid_cell *tc = &tty->cell;
|
||||||
int have_ax;
|
|
||||||
|
|
||||||
/* No changes? Nothing is necessary. */
|
/* No changes? Nothing is necessary. */
|
||||||
if (gc->fg == tc->fg && gc->bg == tc->bg && gc->us == tc->us)
|
if (gc->fg == tc->fg && gc->bg == tc->bg && gc->us == tc->us)
|
||||||
|
Loading…
Reference in New Issue
Block a user