diff options
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/options.c b/src/options.c index 8fbdbfb..120541a 100644 --- a/src/options.c +++ b/src/options.c @@ -70,6 +70,7 @@ void init_parse_options(int argc, char **argv) #ifdef HAVE_LIBXINERAMA /* if we're using xinerama, then enable it by default */ opt.xinerama = 1; + opt.xinerama_index = -1; #endif /* HAVE_LIBXINERAMA */ feh_getopt_theme(argc, argv); @@ -236,7 +237,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 +266,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 +276,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'; @@ -401,6 +405,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"no-fehbg" , 0, 0, 236}, {"keep-zoom-vp" , 0, 0, 237}, {"scroll-step" , 1, 0, 238}, + {"xinerama-index", 1, 0, 239}, {0, 0, 0, 0} }; @@ -421,6 +426,10 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) break; case '<': XParseGeometry(optarg, &discard, &discard, &opt.max_width, &opt.max_height); + if (opt.max_width == 0) + opt.max_width = UINT_MAX; + if (opt.max_height == 0) + opt.max_height = UINT_MAX; break; case '>': XParseGeometry(optarg, &discard, &discard, &opt.min_width, &opt.min_height); @@ -737,6 +746,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 238: opt.scroll_step = atoi(optarg); break; + case 239: + opt.xinerama_index = atoi(optarg); + break; default: break; } |