]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fset_charset_priority): Pay attention to dumplicated arguments.
authorKenichi Handa <handa@m17n.org>
Fri, 6 Jun 2003 03:57:34 +0000 (03:57 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 6 Jun 2003 03:57:34 +0000 (03:57 +0000)
src/charset.c

index e53fbf915fa9a0452f9b9d3dc13da7605fadd29e..a651d2ffb74329ba83ee825946f38e998288e673 100644 (file)
@@ -1994,15 +1994,19 @@ usage: (set-charset-priority &rest charsets)  */)
      int nargs;
      Lisp_Object *args;
 {
-  Lisp_Object new_head = Qnil, old_list, arglist[2];
+  Lisp_Object new_head, old_list, arglist[2];
   int i, id;
 
   old_list = Fcopy_sequence (Vcharset_ordered_list);
+  new_head = Qnil;
   for (i = 0; i < nargs; i++)
     {
       CHECK_CHARSET_GET_ID (args[i], id);
-      old_list = Fdelq (make_number (id), old_list);
-      new_head = Fcons (make_number (id), new_head);
+      if (! NILP (Fmemq (make_number (id), old_list)))
+       {
+         old_list = Fdelq (make_number (id), old_list);
+         new_head = Fcons (make_number (id), new_head);
+       }
     }
   arglist[0] = Fnreverse (new_head);
   arglist[1] = old_list;