changeset 38371:eb915f0b1d6e

(menubar_selection_callback, w32_menu_show): Initialize `entry' to nil. (w32_dialog_show): Remove unused `save_wv' variable. (name_is_separator): Recognize "--:foo" and "--foo-bar".
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 11 Jul 2001 18:30:34 +0000
parents 8ff8080320ad
children 626cbad85e8c
files src/w32menu.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32menu.c	Wed Jul 11 15:45:24 2001 +0000
+++ b/src/w32menu.c	Wed Jul 11 18:30:34 2001 +0000
@@ -964,6 +964,7 @@
 
   if (!f)
     return;
+  entry = Qnil;
   subprefix_stack = (Lisp_Object *) alloca (f->menu_bar_items_used * sizeof (Lisp_Object));
   vector = f->menu_bar_vector;
   prefix = Qnil;
@@ -1765,7 +1766,7 @@
     {
       Lisp_Object prefix, entry;
 
-      prefix = Qnil;
+      prefix = entry = Qnil;
       i = 0;
       while (i < menu_items_used)
 	{
@@ -1833,7 +1834,7 @@
   char dialog_name[6];
   int menu_item_selection;
 
-  widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
+  widget_value *wv, *first_wv = 0, *prev_wv = 0;
 
   /* Number of elements seen so far, before boundary.  */
   int left_count = 0;
@@ -2012,9 +2013,14 @@
 name_is_separator (name)
      char *name;
 {
-  /* Check if name string consists of only dashes ('-') */
+  char *start = name;
+
+  /* Check if name string consists of only dashes ('-').  */
   while (*name == '-') name++;
-  return (*name == '\0');
+  /* Separators can also be of the form "--:TripleSuperMegaEtched"
+     or "--deep-shadow".  We don't implement them yet, se we just treat
+     them like normal separators.  */
+  return (*name == '\0' || start + 2 == name);
 }