--- less-436/pattern.c.eline 2009-07-27 13:24:01.794426172 +0000 +++ less-436/pattern.c 2009-07-27 13:24:28.641107814 +0000 @@ -260,7 +260,10 @@ match_pattern(pattern, tpattern, line, l { regmatch_t rm; int flags = (notbol) ? REG_NOTBOL : 0; - matched = !regexec(spattern, line, 1, &rm, flags); + if(strlen(line)) + matched = !regexec(spattern, line, 1, &rm, flags); + else + matched = 0; if (matched) { #ifndef __WATCOMC__