Package: coreutils Followup-For: Bug #406785 reassign 406785 busybox tag 406785 + patch thanks
Hi, the sort documentation says: | By default, fields are separated by the empty string between a | non-blank character and a blank character. So the leading whitespace before a field is part of that field and gnu sort correctly does that. This (busybox) is my fault. I thought the whitespace would be the seperator. Attached is a patch for busybox do to the same. MfG Goswin -- System Information: Debian Release: 4.0 APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-frosties Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Versions of packages coreutils depends on: ii libacl1 2.2.41-1 Access control list shared library ii libc6 2.3.6.ds1-9 GNU C Library: Shared libraries ii libselinux1 1.32-3 SELinux shared libraries coreutils recommends no packages. -- no debconf information
diff -u busybox-1.1.3/coreutils/sort.c busybox-1.1.3/coreutils/sort.c --- busybox-1.1.3/coreutils/sort.c +++ busybox-1.1.3/coreutils/sort.c @@ -79,7 +79,10 @@ while(str[end]) { if(key_separator) { if(str[end++]==key_separator) break; - } else if(isspace(str[end++])) break; + } else { + if(isspace(str[end])) break; + end++; + } } } }