I noticed that the sed and grep combination in func_lalib_p can be
folded into a single use of sed.  I don't think this is likely to
be a hot spot, but it's an easy fix.

I'm not an expert on sed portability but it doesn't seem to fall afoul
of anything in the autoconf manual.

The patch is against HEAD.

HEAD still passes "make check" on x86-64 Ubuntu hardy with the patch
applied.

* libltdl/config/ltmain.m4sh (func_lalib_p): Avoid using grep to save a
fork.

Cheers,
    Olly
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index ac334dc..03e6571 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -451,8 +451,8 @@ $opt_help || {
 # determined imposters.
 func_lalib_p ()
 {
-    $SED -e 4q "$1" 2>/dev/null \
-      | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+    lalip_p=`$SED "/^# Generated by .*$PACKAGE/q;4Q;d" "$1" 2> /dev/null`
+    test -n "$lalip_p"
 }
 
 # func_lalib_unsafe_p file

Reply via email to