sort: Don't do fallback top-level sort in check mode
The fallback useful to provide a consistent order of tied lines, but in check mode, we don't want it to report disorder for equal lines (according to the passed flags). Thanks to Richard Ipsum for the bug report and proposed patch.
This commit is contained in:
1
sort.c
1
sort.c
@@ -385,6 +385,7 @@ main(int argc, char *argv[])
|
|||||||
/* -b shall only apply to custom key definitions */
|
/* -b shall only apply to custom key definitions */
|
||||||
if (TAILQ_EMPTY(&kdhead) && global_flags)
|
if (TAILQ_EMPTY(&kdhead) && global_flags)
|
||||||
addkeydef("1", global_flags & ~(MOD_STARTB | MOD_ENDB));
|
addkeydef("1", global_flags & ~(MOD_STARTB | MOD_ENDB));
|
||||||
|
if (TAILQ_EMPTY(&kdhead) || (!Cflag && !cflag))
|
||||||
addkeydef("1", global_flags & MOD_R);
|
addkeydef("1", global_flags & MOD_R);
|
||||||
|
|
||||||
if (!argc) {
|
if (!argc) {
|
||||||
|
Reference in New Issue
Block a user