aboutsummaryrefslogtreecommitdiffstats
path: root/include/stringop.h
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-25 00:02:28 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-25 00:14:13 +0100
commit32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3 (patch)
treeb4f10872f5182c8db7fa9629d1567e34e8373ef1 /include/stringop.h
parentswaybar: move headers to include/bar (diff)
downloadsway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.tar.gz
sway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.tar.zst
sway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.zip
Add quotes to multiword arguments.
This adds quotes around multiword arguments before they are passed to `/bin/sh -c` in an exec command. Example: I connect to irc like this: exec termite -e "mosh server tmux a" Without this patch the arguments are passed to sh as: termite -e mosh server tmux a When it should be: termite -e "mosh server tmux a" For the command to work.
Diffstat (limited to 'include/stringop.h')
-rw-r--r--include/stringop.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/stringop.h b/include/stringop.h
index bb681bcd..7c29a745 100644
--- a/include/stringop.h
+++ b/include/stringop.h
@@ -31,6 +31,11 @@ int unescape_string(char *string);
31char *join_args(char **argv, int argc); 31char *join_args(char **argv, int argc);
32char *join_list(list_t *list, char *separator); 32char *join_list(list_t *list, char *separator);
33 33
34/**
35 * Add quotes around any argv with whitespaces.
36 */
37void add_quotes(char **argv, int argc);
38
34// split string into 2 by delim. 39// split string into 2 by delim.
35char *cmdsep(char **stringp, const char *delim); 40char *cmdsep(char **stringp, const char *delim);
36// Split string into 2 by delim, handle quotes 41// Split string into 2 by delim, handle quotes