Check second key for z{x} commands.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 9 Jun 2014 16:42:09 +0000 (18:42 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 9 Jun 2014 16:42:09 +0000 (18:42 +0200)
We assumed to zoom out if the user does not zoom in. So every z{x} with x not
in "ziI" zoomed out.

src/normal.c

index 8877987..7ea484e 100644 (file)
@@ -791,6 +791,11 @@ static VbResult normal_zoom(const NormalCmdInfo *info)
     WebKitWebSettings *setting;
     WebKitWebView *view = vb.gui.webview;
 
+    /* check if the second key is allowed */
+    if (!strchr("iIoOz", info->key2)) {
+        return RESULT_ERROR;
+    }
+
     count = info->count ? (float)info->count : 1.0;
 
     if (info->key2 == 'z') { /* zz reset zoom */