mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 02:04:22 +00:00
Include \n and \t in shell special characters, from Nikolas Skarlatos.
This commit is contained in:
4
format.c
4
format.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: format.c,v 1.408 2026/07/22 08:19:14 nicm Exp $ */
|
/* $OpenBSD: format.c,v 1.409 2026/07/26 15:21:53 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -4307,7 +4307,7 @@ format_quote_shell(const char *s)
|
|||||||
|
|
||||||
at = out = xmalloc(strlen(s) * 2 + 1);
|
at = out = xmalloc(strlen(s) * 2 + 1);
|
||||||
for (cp = s; *cp != '\0'; cp++) {
|
for (cp = s; *cp != '\0'; cp++) {
|
||||||
if (strchr("|&;<>()$`\\\"'*?[# =%", *cp) != NULL)
|
if (strchr("|&;<>()$`\\\"'*?[# =%\n\t", *cp) != NULL)
|
||||||
*at++ = '\\';
|
*at++ = '\\';
|
||||||
*at++ = *cp;
|
*at++ = *cp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user