From d6b5ac0f949b08cab78921b1d95a47ca0a95bc36 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 6 May 2022 11:32:19 +0800 Subject: [PATCH] * lwlib/lwlib.c (lw_separator_p): Fix empty strings being separators. --- lwlib/lwlib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c index 30546b60e51..863f65c915f 100644 --- a/lwlib/lwlib.c +++ b/lwlib/lwlib.c @@ -1324,10 +1324,14 @@ lw_separator_p (const char *label, enum menu_separator *type, int motif_p) { /* Old-style separator, maybe. It's a separator if it contains only dashes. */ - while (*label == '-') - ++label; - separator_p = *label == 0; - *type = SEPARATOR_SHADOW_ETCHED_IN; + if (*label == '-') + { + while (*label == '-') + ++label; + separator_p = *label == 0; + + *type = SEPARATOR_SHADOW_ETCHED_IN; + } } return separator_p; -- 2.39.5