--- sort.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/sort.c b/sort.c index 941b694..e974011 100644 --- a/sort.c +++ b/sort.c @@ -196,7 +196,8 @@ slinecmp(struct line *a, struct line *b) x = strtod(col1.line.data, NULL); y = strtod(col2.line.data, NULL); res = (x < y) ? -1 : (x > y); - } else if (kd->flags & (MOD_D | MOD_F | MOD_I)) { + } else if ((kd->flags & MOD_D) | (kd->flags & MOD_F) | + (kd->flags & MOD_I)) { res = skipmodcmp(&col1.line, &col2.line, kd->flags); } else { res = linecmp(&col1.line, &col2.line); @@ -386,10 +387,13 @@ main(int argc, char *argv[]) usage(); } ARGEND - /* -b shall only apply to custom key definitions */ - if (TAILQ_EMPTY(&kdhead) && global_flags) - addkeydef("1", global_flags & ~(MOD_STARTB | MOD_ENDB)); - addkeydef("1", global_flags & MOD_R); + if (TAILQ_EMPTY(&kdhead)) { + if (global_flags) { + /* -b shall only apply to custom key definitions */ + addkeydef("1", global_flags & ~(MOD_STARTB | MOD_ENDB)); + } + addkeydef("1", global_flags & MOD_R); + } if (!argc) { if (Cflag || cflag) { -- 2.24.1