Subject: Re: PR: bin/12138 [Was: sort crashes]
To: Mark White <mark.white@st-edmund-hall.oxford.ac.uk>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: current-users
Date: 02/16/2001 02:22:31
>[I was running 1.12] ... ah, I see.  This error now only
>occurs for filter mode
>  touch /tmp/emptyfile
>  cat emptyfile | sort -f
>Stace trace follows.

	the patch workarounds the problem, not sure if it is totally correct.

itojun


Index: append.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/sort/append.c,v
retrieving revision 1.9
diff -u -r1.9 append.c
--- append.c	2001/01/18 20:59:43	1.9
+++ append.c	2001/02/15 17:20:28
@@ -80,6 +80,8 @@
 	const u_char *cend, *pend, *start;
 	const struct recheader *crec, *prec;
 
+	if (!*keylist)
+		return;
 	if (*keylist == '\0' && UNIQUE)
 		return;
 	wts1 = wts = ftbl[0].weights;