summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2018-03-10 18:18:21 +0100
committerpgen <p.gen.progs@gmail.com>2018-03-10 18:18:21 +0100
commitbeeaa82f60b20f4995dc2a1a4beb2f355b9dd207 (patch)
treeb41fa0b9afb8f9e7bf76a0680f47affe39520e71
parent970f7660a7ca8eb94fc2450648af4b57a3b4a805 (diff)
Do not number empty words in column mode
-rw-r--r--smenu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/smenu.c b/smenu.c
index afd69e6..7efad2c 100644
--- a/smenu.c
+++ b/smenu.c
@@ -7652,8 +7652,9 @@ main(int argc, char * argv[])
char * tmp = xmalloc(strlen(word->str) + 4 + menu_index_data.length);
int * word_pos = malloc(sizeof(int));
- if (!!regexec(&menu_pattern_re, word->str, (size_t)0, NULL, 0)
- == (menu_index_data.expression == 'm' ? 0 : 1))
+ if (!isempty(word->str)
+ && !!regexec(&menu_pattern_re, word->str, (size_t)0, NULL, 0)
+ == (menu_index_data.expression == 'm' ? 0 : 1))
{
*word_pos = wi;