Hi,

here is an alternative patch simply removing the pointless and buggy
code.  No functional change on OpenBSD, except that unrelated
functionality is no longer clobbered, of course.

Do you prefer that?

Yours,
  Ingo


Index: yacc.y
===================================================================
RCS file: /cvs/src/usr.bin/mklocale/yacc.y,v
retrieving revision 1.9
diff -u -p -r1.9 yacc.y
--- yacc.y      11 Nov 2015 02:52:46 -0000      1.9
+++ yacc.y      3 May 2016 14:53:15 -0000
@@ -64,7 +64,6 @@ rune_t        charsetmask = (rune_t)0x0000007f;
 rune_t charsetmask = (rune_t)0xffffffff;
 
 void set_map(rune_map *, rune_list *, u_int32_t);
-void set_digitmap(rune_map *, rune_list *);
 void add_map(rune_map *, rune_list *, u_int32_t);
 
 int            main(int, char *[]);
@@ -164,8 +163,8 @@ entry       :       ENCODING STRING
                { set_map(&maplower, $2, 0); }
        |       MAPUPPER map
                { set_map(&mapupper, $2, 0); }
-       |       DIGITMAP map
-               { set_digitmap(&types, $2); }
+       |       DIGITMAP mapignore
+               { }
        ;
 
 list   :       RUNE
@@ -235,6 +234,12 @@ map        :       LBRK RUNE RUNE RBRK
                    $$->next = $1;
                }
        ;
+
+mapignore :    LBRK RUNE RUNE RBRK { }
+       |       map LBRK RUNE RUNE RBRK { }
+       |       LBRK RUNE THRU RUNE ':' RUNE RBRK { }
+       |       map LBRK RUNE THRU RUNE ':' RUNE RBRK { }
+       ;
 %%
 
 int debug = 0;
@@ -343,26 +348,6 @@ set_map(rune_map *map, rune_list *list, 
     while (list) {
        rune_list *nlist = list->next;
        add_map(map, list, flag);
-       list = nlist;
-    }
-}
-
-void
-set_digitmap(rune_map *map, rune_list *list)
-{
-    rune_t i;
-
-    while (list) {
-       rune_list *nlist = list->next;
-       for (i = list->min; i <= list->max; ++i) {
-           if (list->map + (i - list->min)) {
-               rune_list *tmp = xmalloc(sizeof(rune_list));
-               tmp->min = i;
-               tmp->max = i;
-               add_map(map, tmp, list->map + (i - list->min));
-           }
-       }
-       free(list);
        list = nlist;
     }
 }

Reply via email to