changeset 11539:d8227796a997

(Fplist_put): Don't signal an error if plist isn't a cons.
author Karl Heuer <kwzh@gnu.org>
date Mon, 24 Apr 1995 19:43:15 +0000
parents d0bd2102adbc
children b8b8a11a1aed
files src/fns.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Mon Apr 24 18:28:50 1995 +0000
+++ b/src/fns.c	Mon Apr 24 19:43:15 1995 +0000
@@ -880,13 +880,12 @@
   register Lisp_Object tail, prev;
   Lisp_Object newcell;
   prev = Qnil;
-  for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
+  for (tail = plist; CONSP (tail) && CONSP (XCONS (tail)->cdr);
+       tail = XCONS (XCONS (tail)->cdr)->cdr)
     {
-      register Lisp_Object tem;
-      tem = Fcar (tail);
-      if (EQ (prop, tem))
+      if (EQ (prop, XCONS (tail)->car))
 	{
-	  Fsetcar (Fcdr (tail), val);
+	  Fsetcar (XCONS (tail)->cdr, val);
 	  return plist;
 	}
       prev = tail;
@@ -895,7 +894,7 @@
   if (NILP (prev))
     return newcell;
   else
-    Fsetcdr (Fcdr (prev), newcell);
+    Fsetcdr (XCONS (prev)->cdr, newcell);
   return plist;
 }