summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--old/textutils/NEWS1
-rwxr-xr-xtests/misc/sort33
2 files changed, 34 insertions, 0 deletions
diff --git a/old/textutils/NEWS b/old/textutils/NEWS
index af2016d45..95e2a3d34 100644
--- a/old/textutils/NEWS
+++ b/old/textutils/NEWS
@@ -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
index 000000000..06cf6ace7
--- /dev/null
+++ b/tests/misc/sort
@@ -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