diff options
| author | Ron Yorston <rmy@pobox.com> | 2014-01-21 09:40:50 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2014-01-21 09:40:50 +0000 |
| commit | baac891244b03eec99cf14a724ebcdc5877bd4e7 (patch) | |
| tree | a59e8b5156e8d8eb5ea01c518e80f9173c831033 /coreutils | |
| parent | 61a0fc571381226c48728b262495c1c5eafc4fed (diff) | |
| parent | 3b394781b5b9301fc489d9bfff6fbefb4db190f3 (diff) | |
| download | busybox-w32-baac891244b03eec99cf14a724ebcdc5877bd4e7.tar.gz busybox-w32-baac891244b03eec99cf14a724ebcdc5877bd4e7.tar.bz2 busybox-w32-baac891244b03eec99cf14a724ebcdc5877bd4e7.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/sort.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index a1625fc9c..1cb4c3e3f 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
| @@ -225,7 +225,7 @@ static int compare_keys(const void *xarg, const void *yarg) | |||
| 225 | y = *(char **)yarg; | 225 | y = *(char **)yarg; |
| 226 | #endif | 226 | #endif |
| 227 | /* Perform actual comparison */ | 227 | /* Perform actual comparison */ |
| 228 | switch (flags & 7) { | 228 | switch (flags & (FLAG_n | FLAG_M | FLAG_g)) { |
| 229 | default: | 229 | default: |
| 230 | bb_error_msg_and_die("unknown sort type"); | 230 | bb_error_msg_and_die("unknown sort type"); |
| 231 | break; | 231 | break; |
| @@ -302,10 +302,14 @@ static int compare_keys(const void *xarg, const void *yarg) | |||
| 302 | } /* for */ | 302 | } /* for */ |
| 303 | 303 | ||
| 304 | /* Perform fallback sort if necessary */ | 304 | /* Perform fallback sort if necessary */ |
| 305 | if (!retval && !(option_mask32 & FLAG_s)) | 305 | if (!retval && !(option_mask32 & FLAG_s)) { |
| 306 | retval = strcmp(*(char **)xarg, *(char **)yarg); | 306 | retval = strcmp(*(char **)xarg, *(char **)yarg); |
| 307 | flags = option_mask32; | ||
| 308 | } | ||
| 309 | |||
| 310 | if (flags & FLAG_r) | ||
| 311 | return -retval; | ||
| 307 | 312 | ||
| 308 | if (flags & FLAG_r) return -retval; | ||
| 309 | return retval; | 313 | return retval; |
| 310 | } | 314 | } |
| 311 | 315 | ||
