summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-11-23 08:31:29 +0100
committerSébastien Helleu <flashcode@flashtux.org>2014-11-23 08:31:29 +0100
commitae013b788169cbabddd8111bbe183695969cd30a (patch)
treebe13b6c0f6585e89f43f6b8d6f1c1bb768fe7ecd /src
parent3fac3b1bf9ba30ec09e503509c7ac3e25d29a14c (diff)
downloadweechat-ae013b788169cbabddd8111bbe183695969cd30a.zip
core: fix regex replace in eval_expression when regex or regex_replace is empty
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c
index 2bbd0a15c..4dd90c54b 100644
--- a/src/core/wee-eval.c
+++ b/src/core/wee-eval.c
@@ -1080,7 +1080,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers,
/* check for regex */
ptr_value = hashtable_get (options, "regex");
- if (ptr_value && ptr_value[0])
+ if (ptr_value)
{
regex = malloc (sizeof (*regex));
if (string_regcomp (regex, ptr_value,
@@ -1097,7 +1097,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers,
/* check for regex replacement (evaluated later) */
ptr_value = hashtable_get (options, "regex_replace");
- if (ptr_value && ptr_value[0])
+ if (ptr_value)
{
regex_replace = ptr_value;
}