1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-19 02:38:47 +00:00

Sync OpenBSD patchset 1113:

Ignore line continuation when escaped as \\, from Simon Nicolussi.
This commit is contained in:
Tiago Cunha 2012-05-22 20:50:51 +00:00
parent 3604b31b6f
commit 04bf0d8efc
2 changed files with 5 additions and 2 deletions

4
cfg.c
View File

@ -109,7 +109,9 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
len = strlen(line); len = strlen(line);
if (len > 0 && line[len - 1] == '\\') { if (len > 0 && line[len - 1] == '\\') {
line[len - 1] = '\0'; line[len - 1] = '\0';
continue; /* Ignore escaped backslash at EOL. */
if (len > 1 && line[len - 2] != '\\')
continue;
} }
buf = line; buf = line;
line = NULL; line = NULL;

3
tmux.1
View File

@ -497,7 +497,8 @@ Multiple commands may be specified together as part of a
.Em command sequence . .Em command sequence .
Each command should be separated by spaces and a semicolon; Each command should be separated by spaces and a semicolon;
commands are executed sequentially from left to right and commands are executed sequentially from left to right and
lines ending with a backslash continue on to the next line. lines ending with a backslash continue on to the next line,
except when escaped by another backslash.
A literal semicolon may be included by escaping it with a backslash (for A literal semicolon may be included by escaping it with a backslash (for
example, when specifying a command sequence to example, when specifying a command sequence to
.Ic bind-key ) . .Ic bind-key ) .