]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* clcommit.m4sh: Test whether the shell understands `read -r'. Use as
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 1 Feb 2005 12:31:43 +0000 (12:31 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 1 Feb 2005 12:31:43 +0000 (12:31 +0000)
`$read_r' if available, so `\' is preserved in commit notices.

ChangeLog
clcommit.m4sh

index 3bef82b8ee5fe6c5795ab58ffc154e6c828ae751..d2fe5584b6ce511818a7d3ff559a0ac5c432623a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-02-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * clcommit.m4sh: Test whether the shell understands `read -r'.  Use as
+       `$read_r' if available, so `\' is preserved in commit notices.
+
        * HACKING (Editing `.m4sh' Files): Document preferred function
        header layout.
        * config/ltmain.m4sh (func_win32_libid, func_infer_tag)
index dfd33881347ad4093d50e72085508d3032844963..8e93d779381c89ab4a3a152943a111cc88c8b56d 100644 (file)
@@ -101,6 +101,14 @@ mailnotify_flags=
 sendmail_to=
 exit_cmd=:
 
+# try to find out whether read supports -r
+if echo bt | tr b '\\' | { read -r line; test "X$line" = 'X\t'; } 2>/dev/null
+then
+  read_r='read -r'
+else
+  read_r=read
+fi
+
 # Locations for important files:
 signature_file=
 log_dir="`func_mktempdir`"
@@ -297,7 +305,7 @@ func_check_conflicts ()
     func_verbose "$progname: checking for conflicts..."
     if $opt_tla; then
       if ( $TLA changes |
-           while read line; do
+           while $read_r line; do
              echo "$line"
              echo "$line" >&3
            done | grep '^C'
@@ -308,7 +316,7 @@ func_check_conflicts ()
 
     if test -f CVS/Entries; then
       if ( $CVS $cvs_flags -q -n update $update_flags ${1+"$@"} |
-            while read line; do
+            while $read_r line; do
              echo "$line"
              echo "$line" >&3
             done | grep '^C'
@@ -340,7 +348,7 @@ func_check_commit_msg ()
     if $opt_first; then
       skipping=:
       $SED 's,^,+,' < ${ChangeLog-ChangeLog} |
-        while read line; do
+        while $read_r line; do
           case "$line" in
             "+") if $skipping; then skipping=false; else break; fi;;
             "+ "*)
@@ -358,7 +366,7 @@ func_check_commit_msg ()
         cmd="$CVS $cvs_flags diff -u"
       fi
       $cmd ${ChangeLog-ChangeLog} |
-        while read line; do
+        while $read_r line; do
           case $line in
             "--- "*) :;;
             "-"*)