From 9248f75853f8b316d0aca1cb3960e53df12b1331 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Feb 2015 23:15:14 +0100 Subject: options: allow things like --geometry=x50 Although the use is somewhat questionable, it seems strange that e.g. --geometry=50% works (and sets the width only), but setting the height only in a similar manner does not work. --- options/m_option.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/options/m_option.c b/options/m_option.c index fb3d48c46b..de65587884 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1801,7 +1801,7 @@ static bool parse_geometry_str(struct m_geometry *gm, bstr s) if (s.len == 0) return true; // Approximate grammar: - // [W[xH]][{+-}X{+-}Y] | [X:Y] + // [[W][xH]][{+-}X{+-}Y] | [X:Y] // (meaning: [optional] {one character of} one|alternative) // Every number can be followed by '%' int num; @@ -1825,7 +1825,8 @@ static bool parse_geometry_str(struct m_geometry *gm, bstr s) if (bstrchr(s, ':') < 0) { gm->wh_valid = true; if (!bstr_startswith0(s, "+") && !bstr_startswith0(s, "-")) { - READ_NUM(w, w_per); + if (!bstr_startswith0(s, "x")) + READ_NUM(w, w_per); if (bstr_eatstart0(&s, "x")) READ_NUM(h, h_per); } -- cgit v1.2.3