From: Po Lu Date: Fri, 6 May 2022 03:32:19 +0000 (+0800) Subject: * lwlib/lwlib.c (lw_separator_p): Fix empty strings being separators. X-Git-Tag: emacs-29.0.90~1931^2~33 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6b5ac0f949b08cab78921b1d95a47ca0a95bc36;p=emacs.git * lwlib/lwlib.c (lw_separator_p): Fix empty strings being separators. --- 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;