libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid Solaris sed regex limitation


From: Ralf Wildenhues
Subject: Avoid Solaris sed regex limitation
Date: Sun, 1 Nov 2009 11:46:53 +0100
User-agent: Mutt/1.5.20 (2009-08-09)

As per
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/6880>,
we should avoid \{M,N\} after \(...\) for Solaris /bin/sed.  I found
only one instance in the Libtool code base, pushing the patch below
to fix it; alongside, simplifying the quoting here.

Cheers,
Ralf

    Fix func_normal_abspath sed script for Solaris.
    
    * libltdl/config/general.m4sh (pathcar, pathcdr, removedotparts)
    (collapseslashes, finalslash): Use single quotes, for clarity.
    (removedotparts): Avoid \{N,M\} after subexpression \(...\), for
    Solaris /bin/sed.

diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
index 53fafba..fcf75e9 100644
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -101,11 +101,14 @@ func_dirname_and_basename ()
 # Generated shell functions inserted here.
 
 # These SED scripts presuppose an absolute path with a trailing slash.
-pathcar="s,^/\([^/]*\).*$,\1,"
-pathcdr="s,^/[^/]*,,"
-removedotparts="s@/\(\./\)\{1,\}@/@g;s,/\.$,/,"
-collapseslashes="s@/\{1,\}@/@g"
-finalslash="s,/*$,/,"
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+               s@/\./@/@g
+               t dotsl
+               s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
 
 # func_normal_abspath PATH
 # Remove doubled-up and trailing slashes, "." path components,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]