summaryrefslogtreecommitdiff
path: root/src/sort.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-05-06 08:07:46 +0100
committerPádraig Brady <P@draigBrady.com>2011-05-06 08:07:46 +0100
commitebce7bfb1b2e745553043b8d7feb7c2131426fc2 (patch)
treec51b1d8bc1056cbc58390389d1565db79a7fd7f5 /src/sort.c
parent9aeffd3fe549116c043b61ec0d593a7d4c004a44 (diff)
downloadcoreutils-ebce7bfb1b2e745553043b8d7feb7c2131426fc2.tar.xz
sort: fix a contradictory --debug warning
* src/sort.c (key_warn): `sort -k2,1n --debug` would output warnings about being both "zero width" and "spanning multiple fields". Suppress the latter one. * tests/misc/sort-debug-warn: Add a couple of test cases.
Diffstat (limited to 'src/sort.c')
-rw-r--r--src/sort.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c
index 07d6765ac..e10159a9b 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -2385,7 +2385,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only)
size_t eword = key->eword + 1;
if (!sword)
sword++;
- if (sword != eword)
+ if (!eword || sword < eword)
error (0, 0, _("key %lu is numeric and spans multiple fields"),
keynum);
}