pkgbuilds/rxvt-unicode/0002-Fix-test.patch

27 lines
937 B
Diff

From df4d3d7d5c99a2021962abe82345c3739b5ec209 Mon Sep 17 00:00:00 2001
From: Emanuele Giaquinta <e.giaquinta@glauco.it>
Date: Thu, 30 Jun 2016 12:50:36 +0000
Subject: [PATCH 02/11] Fix test.
---
src/command.C | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/command.C b/src/command.C
index caf939d2..89f51cd4 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3403,7 +3403,9 @@ rxvt_term::map_rgb24_color (unsigned int r, unsigned int g, unsigned int b)
if (rgb24_color[index] == color)
return index + minTermCOLOR24;
- if (IN_RANGE_INC (rgb24_seqno[idx], rgb24_seqno[index], 0x7fff))
+ // like (rgb24_seqno[idx] > rgb24_seqno[index])
+ // but also handles wrap around values good enough
+ if ((uint16_t) (rgb24_seqno[idx] - rgb24_seqno[index]) < 0x7fff)
idx = index;
}
}
--
2.13.0