]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixes: debbugs:11141
authorAndreas Schwab <schwab@linux-m68k.org>
Sun, 1 Apr 2012 16:42:57 +0000 (18:42 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Sun, 1 Apr 2012 16:42:57 +0000 (18:42 +0200)
* w32menu.c (is_simple_dialog): Properly check lisp types.

src/ChangeLog
src/w32menu.c

index 9be289c42bbbc7c0b58df7cf315ee9c2280feed8..ee54c48cd94a068994fdc24e1a8b7fe3bc10938f 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * w32menu.c (is_simple_dialog): Properly check lisp types.
+       (Bug#11141)
+
 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
index b5cc6801a72d2d71c00b9009ad49bc7a14c940f2..b25edf0f26963e7fda5184fd8ef73c616e6195ae 100644 (file)
@@ -1173,18 +1173,23 @@ w32_dialog_show (FRAME_PTR f, int keymaps,
 static int
 is_simple_dialog (Lisp_Object contents)
 {
-  Lisp_Object options = XCDR (contents);
+  Lisp_Object options;
   Lisp_Object name, yes, no, other;
 
+  if (!CONSP (contents))
+    return 0;
+  options = XCDR (contents);
+
   yes = build_string ("Yes");
   no = build_string ("No");
 
   if (!CONSP (options))
     return 0;
 
-  name = XCAR (XCAR (options));
-  if (!CONSP (options))
+  name = XCAR (options);
+  if (!CONSP (name))
     return 0;
+  name = XCAR (name);
 
   if (!NILP (Fstring_equal (name, yes)))
     other = no;
@@ -1197,7 +1202,10 @@ is_simple_dialog (Lisp_Object contents)
   if (!CONSP (options))
     return 0;
 
-  name = XCAR (XCAR (options));
+  name = XCAR (options);
+  if (!CONSP (name))
+    return 0;
+  name = XCAR (name);
   if (NILP (Fstring_equal (name, other)))
     return 0;