]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
*** empty log message ***
authorJim Meyering <jim@meyering.net>
Mon, 14 Jan 2002 08:52:45 +0000 (08:52 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 14 Jan 2002 08:52:45 +0000 (08:52 +0000)
old/textutils/NEWS
tests/misc/sort [new file with mode: 0755]

index af2016d45ae24a1f33ba3ac420d6b5fb9169c01d..95e2a3d349ce9e985a31880c1b46da334d545555 100644 (file)
@@ -1,5 +1,6 @@
 Changes in release 2.1
 [2.0.20]
+* sort -m no longer segfaults when given an empty file
 * sort -S now accepts 'K' as a synonym for 'k'.
 * wc recognizes all locale-defined white-space characters, not just those
     in the "C" locale.
diff --git a/tests/misc/sort b/tests/misc/sort
new file mode 100755 (executable)
index 0000000..06cf6ac
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+: ${PERL=perl}
+: ${srcdir=.}
+
+case "$PERL" in
+  *'missing perl')
+  echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
+  exit 77
+  ;;
+esac
+
+exec $PERL -w -I$srcdir/.. -MFetish -- - <<\EOF
+require 5.003;
+use strict;
+
+(my $program_name = $0) =~ s|.*/||;
+
+# Turn off localisation of executable's ouput.
+@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+
+my @Tests =
+    (
+     ['m1', '-m', {IN=> {empty=> ''}}, {IN=> {f=> "foo\n"}}, {OUT=>"foo\n"}],
+    );
+
+my $save_temps = $ENV{DEBUG};
+my $verbose = $ENV{VERBOSE};
+
+my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
+exit $fail;
+EOF