]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
HP-UX portability.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Dec 2001 18:29:53 +0000 (18:29 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:28:56 +0000 (00:28 +0200)
tests/ChangeLog
tests/msgfilter-1

index ae894a7a39755e6f86fb1b28cc492930a1529845..a478edf31119dd3e172edb5fa1cea501f006497b 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-21  Bruno Haible  <bruno@clisp.org>
+
+       * msgfilter-1: Avoid failure on HP-UX, due to strange 'fold' program.
+
 2001-12-20  Bruno Haible  <bruno@clisp.org>
 
        * lang-c: Pass --mode argument to libtool.
index b61d25cfc31d7c2887f2e4c313ea860e7440c616..0746a47db1e356f0c091bfb0899f673a890837ef 100755 (executable)
@@ -5,9 +5,26 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='        '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
 # Some fold programs (like SunOS4) don't have an option to wrap at spaces.
 echo abc | fold -b -s -w 20 >/dev/null 2>&1 || { echo "SKIP: msgfilter-1"; rm -fr $tmpfiles; exit 77; }
 
+# Some fold programs (like HP-UX) insert a newline at the end, if the last
+# line was not terminated with a newline and the -s option was given.
+foldoutputcount=`echo $ac_n "abc$ac_c" | fold -b -s -w 20 | wc -c`
+test "$foldoutputcount" = 3 || { echo "SKIP: msgfilter-1"; rm -fr $tmpfiles; exit 77; }
+
 tmpfiles="$tmpfiles mfi-test1.po"
 cat <<EOF > mfi-test1.po
 # HEADER.