diff options
author | schwarze <schwarze@openbsd.org> | 2016-05-08 15:25:44 +0000 |
---|---|---|
committer | schwarze <schwarze@openbsd.org> | 2016-05-08 15:25:44 +0000 |
commit | 4efe9bdeb347d2cf629adc572303e31e682c11d6 (patch) | |
tree | 2d07510f1ddf99821cc8d7660c8252953fa35149 /usr.bin/mklocale | |
parent | Change where_history() to agree with the GNU implementation: (diff) | |
download | wireguard-openbsd-4efe9bdeb347d2cf629adc572303e31e682c11d6.tar.xz wireguard-openbsd-4efe9bdeb347d2cf629adc572303e31e682c11d6.zip |
Delete encoding code for the unused TODIGIT information.
I'm not aware of plans to add any TODIGIT support,
and when shown on tech@, people were more or less indifferent
and showed confusion about what this code even did.
But the encoding code was buggy, in particular lacking validity
checks, and hence clobbered other important data, in particular
character type and character width data, with consequences that
are hard to judge.
Diffstat (limited to 'usr.bin/mklocale')
-rw-r--r-- | usr.bin/mklocale/mklocale.1 | 8 | ||||
-rw-r--r-- | usr.bin/mklocale/yacc.y | 33 |
2 files changed, 14 insertions, 27 deletions
diff --git a/usr.bin/mklocale/mklocale.1 b/usr.bin/mklocale/mklocale.1 index 983615cc6f3..d190124b8cd 100644 --- a/usr.bin/mklocale/mklocale.1 +++ b/usr.bin/mklocale/mklocale.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mklocale.1,v 1.4 2010/09/19 21:30:05 jmc Exp $ +.\" $OpenBSD: mklocale.1,v 1.5 2016/05/08 15:25:44 schwarze Exp $ .\" .\" $NetBSD: mklocale.1,v 1.13 2004/01/24 17:03:26 wiz Exp $ .\" FreeBSD: src/usr.bin/mklocale/mklocale.1,v 1.6 1999/09/20 09:15:21 phantom Exp @@ -35,7 +35,7 @@ .\" .\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: September 19 2010 $ +.Dd $Mdocdate: May 8 2016 $ .Dt MKLOCALE 1 .Os .Sh NAME @@ -204,7 +204,9 @@ is the integer value represented by For example, the ASCII character .Sq 0 would map to the decimal value 0. -Only values up to 255 are allowed. +On +.Ox , +this information is ignored and not put into the binary output file. .El .Pp The following keywords may appear multiple times and have the following diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y index f489517ab64..091591fcab2 100644 --- a/usr.bin/mklocale/yacc.y +++ b/usr.bin/mklocale/yacc.y @@ -1,4 +1,4 @@ -/* $OpenBSD: yacc.y,v 1.9 2015/11/11 02:52:46 deraadt Exp $ */ +/* $OpenBSD: yacc.y,v 1.10 2016/05/08 15:25:44 schwarze Exp $ */ /* $NetBSD: yacc.y,v 1.24 2004/01/05 23:23:36 jmmv Exp $ */ %{ @@ -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; @@ -348,26 +353,6 @@ set_map(rune_map *map, rune_list *list, u_int32_t flag) } 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; - } -} - -void add_map(rune_map *map, rune_list *list, u_int32_t flag) { rune_t i; |