summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/options.c b/src/options.c
index c874832..bf5c67c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -24,10 +24,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <strings.h>
+
#include "feh.h"
#include "filelist.h"
#include "options.h"
-#include <strings.h>
static void check_options(void);
static void feh_getopt_theme(int argc, char **argv);
@@ -213,7 +214,7 @@ static void feh_parse_options_from_string(char *opts)
char *s;
char *t;
char last = 0;
- int inquote = 0;
+ char inquote = 0;
int i = 0;
/* So we don't reinvent the wheel (not again, anyway), we use the
@@ -228,7 +229,7 @@ static void feh_parse_options_from_string(char *opts)
eprintf(PACKAGE " does not support more than 64 words per "
"theme definition.\n Please shorten your lines.");
- if ((*t == ' ') && !(inquote)) {
+ if ((*t == ' ') && !inquote) {
*t = '\0';
num++;
@@ -239,8 +240,10 @@ static void feh_parse_options_from_string(char *opts)
list[num - 1] = feh_string_normalize(s);
break;
- } else if (((*t == '\"') || (*t == '\'')) && last != '\\')
- inquote = !(inquote);
+ } else if ((*t == inquote) && (last != '\\')) {
+ inquote = 0;
+ } else if (((*t == '\"') || (*t == '\'')) && (last != '\\') && !inquote)
+ inquote = *t;
last = *t;
}