lol
1--- nawk/main.c
2+++ nawk/main.c
3@@ -35,7 +35,6 @@
4 #include <errno.h>
5 #include <string.h>
6 #include <locale.h>
7-#include <langinfo.h>
8 #include <libgen.h>
9
10 #define CMDCLASS ""/*"UX:"*/ /* Command classification */
11--- sort/sort.c
12+++ sort/sort.c
13@@ -63,7 +63,6 @@ static const char sccsid[] USED = "@(#)sort.sl 1.37 (gritter) 5/29/05";
14 #include <locale.h>
15 #include <wchar.h>
16 #include <wctype.h>
17-#include <langinfo.h>
18 #include <inttypes.h>
19 #include <errno.h>
20
21@@ -287,18 +286,6 @@ main(int argc, char **argv)
22 else
23 chkblank();
24 compare = cmpf = ccoll ? mb_cur_max > 1 ? cmpm : cmpa : cmpl;
25- setlocale(LC_NUMERIC, "");
26- arg = nl_langinfo(RADIXCHAR);
27- if (mb_cur_max > 1)
28- next(radixchar, arg, i);
29- else
30- radixchar = *arg & 0377;
31- arg = nl_langinfo(THOUSEP);
32- if (mb_cur_max > 1)
33- next(thousep, arg, i);
34- else
35- thousep = *arg & 0377;
36- setlocale(LC_TIME, "");
37 fields = smalloc(NF * sizeof *fields);
38 copyproto();
39 eargv = argv;
40@@ -1088,8 +1075,7 @@ cmp(const char *i, const char *j)
41 } else {
42 sa = elicpy(collba, pa, la, '\n', ignore, code);
43 sb = elicpy(collbb, pb, lb, '\n', ignore, code);
44- n = fp->Mflg ? monthcmp(collba, collbb) :
45- strcoll(collba, collbb);
46+ n = strcmp(collba, collbb);
47 if (n)
48 return n > 0 ? -fp->rflg : fp->rflg;
49 pa = &pa[sa];
50@@ -1570,49 +1556,6 @@ upcdup(const char *s)
51 return r;
52 }
53
54-static const char *months[12];
55-
56-#define COPY_ABMON(m) months[m-1] = upcdup(nl_langinfo(ABMON_##m))
57-
58-static void
59-fillmonths(void)
60-{
61- COPY_ABMON(1);
62- COPY_ABMON(2);
63- COPY_ABMON(3);
64- COPY_ABMON(4);
65- COPY_ABMON(5);
66- COPY_ABMON(6);
67- COPY_ABMON(7);
68- COPY_ABMON(8);
69- COPY_ABMON(9);
70- COPY_ABMON(10);
71- COPY_ABMON(11);
72- COPY_ABMON(12);
73-}
74-
75-static int
76-monthcoll(const char *s)
77-{
78- int i;
79- char u[MB_LEN_MAX*3+1];
80-
81- cpcu3(u, s);
82- for (i = 0; i < 12; i++)
83- if (strcmp(u, months[i]) == 0)
84- return i;
85- return 0;
86-}
87-
88-
89-static int
90-monthcmp(const char *pa, const char *pb)
91-{
92- if (months[0] == NULL)
93- fillmonths();
94- return monthcoll(pa) - monthcoll(pb);
95-}
96-
97 /*
98 * isblank() consumes half of execution time (in skip()) with
99 * glibc 2.3.1. Check if it contains only space and tab, and