From 09ae9470d71a1459bc058f472ef859c76a493d35 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 6 Jul 2022 15:37:19 -0400 Subject: Apply all string modifiers when present not just the first one it detects --- main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index 425cbc0..d50df4c 100644 --- a/main.c +++ b/main.c @@ -300,19 +300,18 @@ int main(int argc, char *argv[]) { } } - if (do_random_case) { + if (do_random_case) str_random_case(buf); - } else if (do_hill_case) { + if (do_hill_case) str_hill_case(buf); - } else if (do_leet) { + if (do_leet) strcpy(buf, str_leet(buf)); - } else if (do_title_case) { + if (do_title_case) str_title_case(buf); - } else if (do_shuffle) { + if (do_shuffle) str_randomize_words(buf); - } else if (do_reverse) { + if (do_reverse) str_reverse(buf); - } if (do_json && limit) { JSON_LIST_APPEND(stdout, buf); -- cgit