diff options
| -rw-r--r-- | src/search.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index d1a57887c25..a4e17a7eff4 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -880,13 +880,14 @@ search_command (string, bound, noerror, count, direction, RE, posix) | |||
| 880 | { | 880 | { |
| 881 | CHECK_NUMBER_COERCE_MARKER (bound, 1); | 881 | CHECK_NUMBER_COERCE_MARKER (bound, 1); |
| 882 | lim = XINT (bound); | 882 | lim = XINT (bound); |
| 883 | lim_byte = CHAR_TO_BYTE (lim); | ||
| 884 | if (n > 0 ? lim < PT : lim > PT) | 883 | if (n > 0 ? lim < PT : lim > PT) |
| 885 | error ("Invalid search bound (wrong side of point)"); | 884 | error ("Invalid search bound (wrong side of point)"); |
| 886 | if (lim > ZV) | 885 | if (lim > ZV) |
| 887 | lim = ZV, lim_byte = ZV_BYTE; | 886 | lim = ZV, lim_byte = ZV_BYTE; |
| 888 | if (lim < BEGV) | 887 | else if (lim < BEGV) |
| 889 | lim = BEGV, lim_byte = BEGV_BYTE; | 888 | lim = BEGV, lim_byte = BEGV_BYTE; |
| 889 | else | ||
| 890 | lim_byte = CHAR_TO_BYTE (lim); | ||
| 890 | } | 891 | } |
| 891 | 892 | ||
| 892 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, | 893 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, |