diff options
author | Karl Fogel <kfogel@red-bean.com> | 2019-03-16 21:29:04 -0500 |
---|---|---|
committer | Karl Fogel <kfogel@red-bean.com> | 2019-03-16 21:40:49 -0500 |
commit | fa9c38e6e7f1caa12d38f35c5633735bcaef3ba1 (patch) | |
tree | 56f1bf75e791d884cbc9309f0daaeb3d33092b09 /handle.c | |
parent | c5a5fb06fd25c044f343f4571c645fd6c954d038 (diff) |
Fix warning about number of mouse buttons
Change a warning to distinguish between too few buttons and too many.
Before this change:
$ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
Warning: Only changing the first 15 of 10 buttons.
$
After this change:
$ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
Warning: Not changing 5 extra buttons beyond 10.
$
Fixes: https://gitlab.freedesktop.org/xorg/app/xmodmap/issues/2
Signed-off-by: Karl Fogel <kfogel@red-bean.com>
Diffstat (limited to 'handle.c')
-rw-r--r-- | handle.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -889,8 +889,16 @@ do_pointer(char *line, int len) } if (i > 0 && i != nbuttons) { - fprintf (stderr, "Warning: Only changing the first %d of %d buttons.\n", - i, nbuttons); + if (i < nbuttons) { + fprintf (stderr, + "Warning: Only changing the first %d of %d buttons.\n", + i, nbuttons); + } + else { /* i > nbuttons */ + fprintf (stderr, + "Warning: Not changing %d extra buttons beyond %d.\n", + i - nbuttons, nbuttons); + } i = nbuttons; } |