tweaks: add another warning for an impossible condition

master
Benno Schulenberg 2017-05-02 10:29:36 +02:00
parent f5155786e1
commit 4953dcec20
1 changed files with 3 additions and 2 deletions

View File

@ -237,9 +237,10 @@ bool is_separate_word(size_t position, size_t length, const char *buf)
const char *strstrwrapper(const char *haystack, const char *needle, const char *strstrwrapper(const char *haystack, const char *needle,
const char *start) const char *start)
{ {
/* Just in case we search for an empty needle. :/ */ if (*needle == '\0') {
if (*needle == '\0') statusline(ALERT, "Searching for nothing -- please report a bug");
return (char *)start; return (char *)start;
}
if (ISSET(USE_REGEXP)) { if (ISSET(USE_REGEXP)) {
if (ISSET(BACKWARDS_SEARCH)) { if (ISSET(BACKWARDS_SEARCH)) {