kdrive: handle WxH as valid geometry spec
authorKeith Packard <keithp@keithp.com>
Thu, 14 Nov 2013 03:21:54 +0000 (13:21 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 14 Nov 2013 03:34:18 +0000 (13:34 +1000)
If a screen size was specified as WxH, the loop returned early and kdOrigin
was never advanced. Thus, screen->origin was always 0 (or whatever was given
at the -origin commandline flag).

If a screen size was given with a bit depth (WxHxD), kdOrigin would always
advance by the current screen, offsetting the next screen.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
hw/kdrive/src/kdrive.c

index f8949be..3829684 100644 (file)
@@ -328,7 +328,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
             screen->height = pixels;
             screen->height_mm = mm;
         }
-        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y')
+        if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' &&
+            (delim != '\0' || i == 0))
             return;
     }