]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fdefconst, Fdefvar): Error if too many arguments.
authorRichard M. Stallman <rms@gnu.org>
Thu, 15 Dec 1994 00:42:19 +0000 (00:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 15 Dec 1994 00:42:19 +0000 (00:42 +0000)
src/eval.c

index eafb9e84a6553401e40368137d3848e4a555e08f..f5dd69ff0574d9889db5b7fa69df555698a2e54e 100644 (file)
@@ -571,18 +571,21 @@ If INITVALUE is missing, SYMBOL's value is not set.")
   (args)
      Lisp_Object args;
 {
-  register Lisp_Object sym, tem;
+  register Lisp_Object sym, tem, tail;
 
   sym = Fcar (args);
-  tem = Fcdr (args);
-  if (!NILP (tem))
+  tail = Fcdr (args);
+  if (!NILP (Fcdr (Fcdr (tail))))
+    error ("too many arguments");
+
+  if (!NILP (tail))
     {
       tem = Fdefault_boundp (sym);
       if (NILP (tem))
        Fset_default (sym, Feval (Fcar (Fcdr (args))));
     }
-  tem = Fcar (Fcdr (Fcdr (args)));
-  if (!NILP (tem))
+  tail = Fcdr (Fcdr (args));
+  if (!NILP (Fcar (tail)))
     {
       if (!NILP (Vpurify_flag))
        tem = Fpurecopy (tem);
@@ -612,6 +615,9 @@ it would override the user's choice.")
   register Lisp_Object sym, tem;
 
   sym = Fcar (args);
+  if (!NILP (Fcdr (Fcdr (Fcdr (args)))))
+    error ("too many arguments");
+
   Fset_default (sym, Feval (Fcar (Fcdr (args))));
   tem = Fcar (Fcdr (Fcdr (args)));
   if (!NILP (tem))