aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/search.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index e24a2019086..45d3f52fe90 100644
--- a/src/search.c
+++ b/src/search.c
@@ -822,7 +822,10 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
822 of pattern would align in a possible match. */ 822 of pattern would align in a possible match. */
823 while (n != 0) 823 while (n != 0)
824 { 824 {
825 if ((lim - pos - (direction > 0)) * direction < 0) 825 /* It's been reported that some (broken) compiler thinks that
826 Boolean expressions in an arithmetic context are unsigned.
827 Using an explicit ?1:0 prevents this. */
828 if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0)
826 return (n * (0 - direction)); 829 return (n * (0 - direction));
827 /* First we do the part we can by pointers (maybe nothing) */ 830 /* First we do the part we can by pointers (maybe nothing) */
828 QUIT; 831 QUIT;