summaryrefslogtreecommitdiffstats
path: root/patches/06_fix-use-of-undefined-asort-awk-function.patch
blob: 37a629508e095c718b6f47a9b7b027d8572fe4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: "P. J. McDermott" <pjm@nac.net>
Description: Don't use asort() and asorti() awk functions
 BusyBox awk doesn't define them and they aren't necessary for simple array
 iteration.

diff -Naur src.orig/libc/scripts/option-groups.awk src/libc/scripts/option-groups.awk
--- src.orig/libc/scripts/option-groups.awk	2007-12-13 13:16:57.000000000 -0500
+++ src/libc/scripts/option-groups.awk	2013-06-21 11:14:39.304717753 -0400
@@ -32,10 +32,9 @@
     print ""
 
     # Produce a sorted list of variable names.
-    i=0
+    n=0
     for (var in vars)
-        names[i++] = var
-    n = asort (names)
+        names[n++] = var
 
     for (i = 1; i <= n; i++)
     {
diff -Naur src.orig/libc/sysdeps/gnu/errlist-compat.awk src/libc/sysdeps/gnu/errlist-compat.awk
--- src.orig/libc/sysdeps/gnu/errlist-compat.awk	2012-04-21 13:19:39.000000000 -0400
+++ src/libc/sysdeps/gnu/errlist-compat.awk	2013-06-21 13:17:44.606655144 -0400
@@ -84,10 +84,8 @@
     printf "#define ERR_MAX %d\n\n", highest - 1;
   }
 
-  # same regardless of awk's ordering of the associative array.
-  num_compat_elems = asorti(compat, compat_indices)
-  for (i = 1; i <= num_compat_elems; i++) {
-    old = compat_indices[i]
+  for (compat_index in compat) {
+    old = compat_index;
     new = compat[old];
     n = vcount[old];
     printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;