summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-04-12 18:50:40 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-04-12 18:50:40 +0200
commit250662bf9adb16814e84808668d05bc347c063a7 (patch)
tree37cccd0f82c7cb48add2f923b0c7a21b7b07c5c7
parent6d6adf2d56387600c5b67d40097d3d92ceae2a1b (diff)
themes: allow '' for quoting as well (closes #132, see also #187)
-rw-r--r--ChangeLog1
-rw-r--r--src/options.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c739745..32a2266 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ git HEAD
* ~/.fehbg is now a shell script and can be executed directly
(sourcing it still works)
* --max-dimension: ignore width/height limit of 0 pixels
+ * feh/themes: Support quoting with '' too (previously, only "" worked)
Wed, 08 Apr 2015 11:18:41 +0200 Daniel Friesel <derf+feh@finalrewind.org>
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';