changeset 89471:31ac7465ef51

(Fset_charset_priority): Pay attention to dumplicated arguments.
author Kenichi Handa <handa@m17n.org>
date Fri, 06 Jun 2003 03:57:34 +0000
parents 63f863a2a2e2
children 523daff56a65
files src/charset.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Fri Jun 06 03:57:15 2003 +0000
+++ b/src/charset.c	Fri Jun 06 03:57:34 2003 +0000
@@ -1994,15 +1994,19 @@
      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;