diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/core/wee-string.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 6e14834ff..2505b4ff9 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -32,6 +32,7 @@ New features:: Bug fixes:: + * core: fix compilation of empty regular expression (not allowed on FreeBSD) * core: fix forced highlight on messages sent to other buffers (issue #1277) * buflist: add alternate key codes for kbd:[F1]/kbd:[F2] and kbd:[Alt+F1]/kbd:[Alt+F2] (compatibility with terminals) * buflist: fix warning displayed when script buffers.pl is loaded (issue #1274) diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 320b6aa3e..5380ec8d4 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -1204,7 +1204,10 @@ string_regcomp (void *preg, const char *regex, int default_flags) return -1; ptr_regex = string_regex_flags (regex, default_flags, &flags); - return regcomp ((regex_t *)preg, ptr_regex, flags); + + return regcomp ((regex_t *)preg, + (ptr_regex && ptr_regex[0]) ? ptr_regex : "^", + flags); } /* |