From 3c56934ddcfc37313d81e398d757ba89387cbaf3 Mon Sep 17 00:00:00 2001 From: David Yang Date: Tue, 31 Aug 2021 23:31:43 +0800 Subject: [PATCH] Remove whitespace check on -c (#92) Resolves #88 --- src/cmdline.c | 9 --------- test/171_c_right_justify.txt | 8 ++++++++ test/172_c_centering.txt | 8 ++++++++ 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 test/171_c_right_justify.txt create mode 100644 test/172_c_centering.txt diff --git a/src/cmdline.c b/src/cmdline.c index 9e4c467..6ea99dd 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -231,15 +231,6 @@ static int command_line_design(opt_t *result, char *optarg) perror(PROJECT); return 1; } - else { - line_t templine = {0}; - templine.len = strlen(result->cld); - templine.text = result->cld; - if (empty_line(&templine)) { - fprintf(stderr, "%s: boxes may not consist entirely of whitespace\n", PROJECT); - return 1; - } - } result->design_choice_by_user = 1; return 0; } diff --git a/test/171_c_right_justify.txt b/test/171_c_right_justify.txt new file mode 100644 index 0000000..0a78807 --- /dev/null +++ b/test/171_c_right_justify.txt @@ -0,0 +1,8 @@ +:ARGS +-s 100 -a hr -c " " +:INPUT +foo +:OUTPUT-FILTER +:EXPECTED + foo +:EOF diff --git a/test/172_c_centering.txt b/test/172_c_centering.txt new file mode 100644 index 0000000..ae86115 --- /dev/null +++ b/test/172_c_centering.txt @@ -0,0 +1,8 @@ +:ARGS +-s 100 -a hcvc -c " " +:INPUT +foo +:OUTPUT-FILTER +:EXPECTED + foo +:EOF