]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AT_INIT): Don't create a regular
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2005 23:30:13 +0000 (23:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2005 23:30:13 +0000 (23:30 +0000)
expression of unbounded size when processing the --list
option.  This runs afoul of a limit of 399 bytes per regular
expression on AIX.  Problem reported by Ralf Wildenhues.

lib/autotest/general.m4

index 02e32b19ea4bcb6b42f07d1d309bc61feae013ae..831abd9fac82af613b3fc190bb973e9d8137c35c 100644 (file)
@@ -442,12 +442,17 @@ AT_TESTSUITE_NAME test groups:
 
 _ATEOF
   # "  1 42  45 " => "^(1|42|45);".
-  at_groups_pattern=`echo "$at_groups" | sed 's/^  *//;s/  *$//;s/  */|/g'`
   echo "$at_help_all" |
-    awk 'BEGIN { FS = ";" }
-        { if ($[1] !~ /^('"$at_groups_pattern"')$/) next }
-        { if ($[1]) printf " %3d: %-18s %s\n", $[1], $[2], $[3]
-          if ($[4]) printf "      %s\n", $[4] } '
+    awk 'BEGIN {
+          for (n = split("'"$at_groups"'", a); n; n--) selected[[a[n]]] = 1
+          FS = ";"
+        }
+        {
+          if (selected[[$ 1]]) {
+            printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
+            if ($ 4) printf "      %s\n", $ 4
+          }
+        }'
   exit 0
 fi
 m4_divert_pop([HELP_END])dnl