From 250662bf9adb16814e84808668d05bc347c063a7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 12 Apr 2015 18:50:40 +0200 Subject: themes: allow '' for quoting as well (closes #132, see also #187) --- src/options.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/options.c b/src/options.c index 7e7adee..cbeb729 100644 --- a/src/options.c +++ b/src/options.c @@ -236,7 +236,7 @@ static void feh_parse_options_from_string(char *opts) list[num - 1] = feh_string_normalize(s); break; - } else if (*t == '\"' && last != '\\') + } else if (((*t == '\"') || (*t == '\'')) && last != '\\') inquote = !(inquote); last = *t; } @@ -265,6 +265,9 @@ char *feh_string_normalize(char *str) else if ((*s == '\"') && (last == '\\')) ret[i++] = '\"'; else if ((*s == '\"') && (last == 0)); + else if ((*s == '\'') && (last == '\\')) + ret[i++] = '\''; + else if ((*s == '\'') && (last == 0)); else if ((*s == ' ') && (last == '\\')) ret[i++] = ' '; else @@ -272,7 +275,7 @@ char *feh_string_normalize(char *str) last = *s; } - if (i && (ret[i - 1] == '\"')) + if (i && ((ret[i - 1] == '\"') || (ret[i - 1] == '\''))) ret[i - 1] = '\0'; else ret[i] = '\0'; -- cgit v1.2.3