Package: msort
Version: 8.29-1
Severity: important
Tags: patch
Using this command line:
msort -l -n 1 -c d -f y-m-d -n 2 -c t < file
To sort a file with lines like the following was always failing for me:
2007-04-05 14:25:06 ...
2007-04-06 14:25:08 ...
2007-04-05 14:35:08 ...
2007-04-05 14:45:18 ...
I tracked it down to GetDateKey(). Looks like errno is getting set
somewhere else and not cleared. I have attached a tiny patch which fixes
the problem.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.16-ck9-1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages msort depends on:
ii libc6 2.5-11 GNU C Library: Shared libraries
ii libtre4 0.7.5-1 regexp matching library with appro
msort recommends no packages.
-- no debconf information
--
Programs are written for aesthetic beauty.
--- misc.c~ 2006-09-06 20:07:21.000000000 -0700
+++ misc.c 2007-06-19 15:30:04.000000000 -0700
@@ -185,6 +185,8 @@
extern int errno;
+ errno = 0;
+
sepptr1 = wcschr(field,ymd->sep1);
sepptr2 = wcsrchr(field,ymd->sep2);
if( (sepptr1 == NULL) || (sepptr2 == NULL) ) {