mirror of
https://github.com/tmux/tmux.git
synced 2026-10-14 23:34:22 +00:00
Do not use subtraction for comparators, this doesn't really matter for
IDs but it breaks key sorting. GitHub issue 5646 from Alexandre Fiori.
(cherry picked from commit db3950ed07)
This commit is contained in:
14
window.c
14
window.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: window.c,v 1.382 2026/09/28 10:25:43 nicm Exp $ */
|
||||
/* $OpenBSD: window.c,v 1.383 2026/09/28 10:42:01 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -92,7 +92,11 @@ struct window_pane_prompt {
|
||||
int
|
||||
window_cmp(struct window *w1, struct window *w2)
|
||||
{
|
||||
return (w1->id - w2->id);
|
||||
if (w1->id < w2->id)
|
||||
return (-1);
|
||||
if (w1->id > w2->id)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -199,7 +203,11 @@ winlink_cmp(struct winlink *wl1, struct winlink *wl2)
|
||||
int
|
||||
window_pane_cmp(struct window_pane *wp1, struct window_pane *wp2)
|
||||
{
|
||||
return (wp1->id - wp2->id);
|
||||
if (wp1->id < wp2->id)
|
||||
return (-1);
|
||||
if (wp1->id > wp2->id)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct winlink *
|
||||
|
||||
Reference in New Issue
Block a user