diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-07-29 16:05:50 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-07-29 16:05:50 +0200 |
commit | 00f2a35b835c6f49617f5379073e9063e7e683ce (patch) | |
tree | 114bcd038da16a8c9cd7919adbd59255c62487d8 /coreutils | |
parent | 9b6eb2a8ef4f1cfeeea821e270d49ef9c6ae4503 (diff) | |
download | busybox-w32-00f2a35b835c6f49617f5379073e9063e7e683ce.tar.gz busybox-w32-00f2a35b835c6f49617f5379073e9063e7e683ce.tar.bz2 busybox-w32-00f2a35b835c6f49617f5379073e9063e7e683ce.zip |
sort: fix -k2M (wasn't skipping leading whitespace)
function old new delta
compare_keys 848 862 +14
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/sort.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index 9aac656fe..80b578fc2 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -357,9 +357,9 @@ static int compare_keys(const void *xarg, const void *yarg) | |||
357 | int dx; | 357 | int dx; |
358 | char *xx, *yy; | 358 | char *xx, *yy; |
359 | 359 | ||
360 | xx = strptime(x, "%b", &thyme); | 360 | xx = strptime(skip_whitespace(x), "%b", &thyme); |
361 | dx = thyme.tm_mon; | 361 | dx = thyme.tm_mon; |
362 | yy = strptime(y, "%b", &thyme); | 362 | yy = strptime(skip_whitespace(y), "%b", &thyme); |
363 | if (!xx) | 363 | if (!xx) |
364 | retval = (!yy) ? 0 : -1; | 364 | retval = (!yy) ? 0 : -1; |
365 | else if (!yy) | 365 | else if (!yy) |