]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Use a portable
authorAkim Demaille <akim@epita.fr>
Thu, 4 Oct 2001 15:24:31 +0000 (15:24 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 4 Oct 2001 15:24:31 +0000 (15:24 +0000)
combination of Awk and sed to replace $LINENO.

ChangeLog
lib/m4sugar/m4sh.m4

index 1b9dd0681390309f75779dc854a14ddb35fe3760..550954414ba5d7113436f39d3e5cd48702b73816 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-04  Akim Demaille  <akim@epita.fr>
+
+       * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Use a portable
+       combination of Awk and sed to replace $LINENO.
+
 2001-10-02  Paul Eggert  <eggert@twinsun.com>
 
        * doc/autoconf.texi (Limitations of Builtins): You can't use
index e788ea505be729f40c803c80a96984d7ec2f898b..b67fa5cd6cfddee78744e9651b683fa7b0540a75 100644 (file)
@@ -143,12 +143,12 @@ if test "x$as_lineno_1"  = "x$as_lineno_2" ||
                 != x$as_me.lineno; then
      # Be sure to write the pattern so that it doesn't replace itself:
      # it must not match itself.
-     awk '{
-            if ($[0] ~ /[[$]]LINENO/)
-              while (sub (/[[$]]LINENO/, NR))
-                continue
-            print
-          }' <$as_myself >$as_me.lineno
+     awk <$as_myself '
+           /[[$]]LINENO/ { printf "%d:", NR }
+                         { print }
+         ' |
+       sed ['/[$]LINENO/s/^\([0-9][0-9]*\):\(.*\)[$]LINENO/\2\1/'] \
+         >$as_me.lineno
     chmod +x $as_me.lineno
   fi