Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] zcurses mouse delay



On Sat, Jan 13, 2024 at 9:03 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> The test for successful read of a number is wrong, and there's also a
> typo in the call to print an error message in the event of an
> unrecognized mouse subcommand.

Nobody uses zcurses for mouse interaction, I guess.
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index ad17ed65f..8950cc153 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -1302,7 +1302,7 @@ zccmd_mouse(const char *nam, char **args)
 	    zlong delay;
 
 	    if (!*++args ||
-		((delay = zstrtol(*args, &eptr, 10)), eptr != NULL)) {
+		((delay = zstrtol(*args, &eptr, 10)), *eptr != '\0')) {
 		zwarnnam(nam, "mouse delay requires an integer argument");
 		return 1;
 	    }
@@ -1326,7 +1326,7 @@ zccmd_mouse(const char *nam, char **args)
 		if (old_mask != zcurses_mouse_mask)
 		    zcurses_flags |= ZCF_MOUSE_MASK_CHANGED;
 	    } else {
-		zwarnnam(nam, "unrecognised mouse command: %s", *arg);
+		zwarnnam(nam, "unrecognised mouse command: %s", arg);
 		return 1;
 	    }
 	}


Messages sorted by: Reverse Date, Date, Thread, Author