summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-05-17 21:21:31 +0000
committernicm <nicm@openbsd.org>2012-05-17 21:21:31 +0000
commit63a60e4bab12b33c14d36e7967aca7750965b137 (patch)
tree5b80f6e83338da2ce14ad48d9fe786e2c70843a1
parentYet another rework of the crucial gio_id() function responsible for correctly (diff)
downloadwireguard-openbsd-63a60e4bab12b33c14d36e7967aca7750965b137.tar.xz
wireguard-openbsd-63a60e4bab12b33c14d36e7967aca7750965b137.zip
Ignore line continuation when escaped as \\, from Simon Nicolussi.
-rw-r--r--usr.bin/tmux/cfg.c6
-rw-r--r--usr.bin/tmux/tmux.17
2 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c
index a8ed42026a9..6f935622662 100644
--- a/usr.bin/tmux/cfg.c
+++ b/usr.bin/tmux/cfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.13 2011/08/24 10:46:01 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.14 2012/05/17 21:21:31 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -109,7 +109,9 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
len = strlen(line);
if (len > 0 && line[len - 1] == '\\') {
line[len - 1] = '\0';
- continue;
+ /* Ignore escaped backslash at EOL. */
+ if (len > 1 && line[len - 2] != '\\')
+ continue;
}
buf = line;
line = NULL;
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 1cf07381cff..ba2503853cb 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.292 2012/05/02 19:29:13 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.293 2012/05/17 21:21:31 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 2 2012 $
+.Dd $Mdocdate: May 17 2012 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -493,7 +493,8 @@ Multiple commands may be specified together as part of a
.Em command sequence .
Each command should be separated by spaces and a semicolon;
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
example, when specifying a command sequence to
.Ic bind-key ) .