From: Jim Meyering Date: Sun, 7 Mar 1999 16:06:33 +0000 (+0000) Subject: Test for the actual feature. X-Git-Tag: FILEUTILS-4_0e~182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23b14f50e346c7da08ea27b364aea740c5f71bdd;p=thirdparty%2Fcoreutils.git Test for the actual feature. With help from Eli Zaretskii. --- diff --git a/tests/md5sum/newline-1 b/tests/md5sum/newline-1 index 818e9fcfec..4ff544b742 100755 --- a/tests/md5sum/newline-1 +++ b/tests/md5sum/newline-1 @@ -5,14 +5,25 @@ case "$PERL" in *'missing perl') - echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test" + echo 1>&2 "$0: configure didn't find a usable version of Perl," \ + " so can't run this test" exit 77 ;; esac -if test -n "$COMSPEC$ComSpec"; then - # DOS/Windows - echo 1>&2 "$0: This test would always fail on MSDOS/Window systems" +# See if we can create a filename that contains a newline. +# Be careful to do it in a subshell so that we can redirect the +# error output if it fails. +(> 'a +b') 2> /dev/null \ + && filename_may_contain_newline=yes \ + || filename_may_contain_newline=no +rm -f 'a +b' + +if test $filename_may_contain_newline = no; then + echo 1>&2 "$0: can't create newline-containing file name," \ + "so can't run this test" exit 77 fi