summaryrefslogtreecommitdiff
path: root/lwlib/lwlib.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
commit650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch)
tree85d11f6437cde22f410c25e0e5f71a3131ebd07d /lwlib/lwlib.c
parent8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff)
parent4b85ae6a24380fb67a3315eaec9233f17a872473 (diff)
downloademacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip
Merge 'master' into noverlay
Diffstat (limited to 'lwlib/lwlib.c')
-rw-r--r--lwlib/lwlib.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 30fa046cb73..863f65c915f 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -1,7 +1,7 @@
/* A general interface to the widgets of different toolkits.
Copyright (C) 1992, 1993 Lucid, Inc.
-Copyright (C) 1994-1996, 1999-2017 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2022 Free Software Foundation, Inc.
This file is part of the Lucid Widget Library.
@@ -1233,8 +1233,7 @@ lw_separator_p (const char *label, enum menu_separator *type, int motif_p)
{
int separator_p = 0;
- if (strlen (label) >= 3
- && memcmp (label, "--:", 3) == 0)
+ if (strncmp (label, "--:", 3) == 0)
{
static struct separator_table
{
@@ -1276,7 +1275,7 @@ lw_separator_p (const char *label, enum menu_separator *type, int motif_p)
break;
}
}
- else if (strlen (label) > 3
+ else if (strnlen (label, 4) == 4
&& memcmp (label, "--", 2) == 0
&& label[2] != '-')
{
@@ -1325,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;