# HG changeset patch # User Karl Heuer # Date 763681452 0 # Node ID 372613d5970ba40159b139fe36dad8057e744b47 # Parent c9e33093c48856e28522bc68914f9b76884c2164 (search_buffer): Avoid boolean/integer mixing that confuses some compilers. diff -r c9e33093c488 -r 372613d5970b src/search.c --- a/src/search.c Mon Mar 14 21:36:58 1994 +0000 +++ b/src/search.c Mon Mar 14 21:44:12 1994 +0000 @@ -822,7 +822,10 @@ of pattern would align in a possible match. */ while (n != 0) { - if ((lim - pos - (direction > 0)) * direction < 0) + /* It's been reported that some (broken) compiler thinks that + Boolean expressions in an arithmetic context are unsigned. + Using an explicit ?1:0 prevents this. */ + if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0) return (n * (0 - direction)); /* First we do the part we can by pointers (maybe nothing) */ QUIT;