From 56740fcfe2aca9a2651056ced553a1365f4bd2e6 Mon Sep 17 00:00:00 2001 From: arjenmarkus Date: Wed, 16 Sep 2020 17:39:46 +0200 Subject: [PATCH 1/4] Update stdlib_ascii.f90 Correct the is_lower function - I overlooked that one. --- src/stdlib_ascii.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stdlib_ascii.f90 b/src/stdlib_ascii.f90 index c1b159bc7..579f24ef8 100644 --- a/src/stdlib_ascii.f90 +++ b/src/stdlib_ascii.f90 @@ -151,7 +151,9 @@ pure logical function is_printable(c) !> Checks whether `c` is a lowercase ASCII letter (a .. z). pure logical function is_lower(c) character(len=1), intent(in) :: c !! The character to test. - is_lower = (c >= 'a') .and. (c <= 'z') + integer :: ic + ic = iachar(c) + is_lower = (ic >= iachar('a')) .and. (ic <= iachar('z')) end function !> Checks whether `c` is an uppercase ASCII letter (A .. Z). From a996ec53b6044a2f8066c361d58ac1c62cb10993 Mon Sep 17 00:00:00 2001 From: arjenmarkus Date: Wed, 16 Sep 2020 17:44:04 +0200 Subject: [PATCH 2/4] Update stdlib_ascii.f90 Solve a glitch in the function is_printable --- src/stdlib_ascii.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdlib_ascii.f90 b/src/stdlib_ascii.f90 index 579f24ef8..a95d2d254 100644 --- a/src/stdlib_ascii.f90 +++ b/src/stdlib_ascii.f90 @@ -145,7 +145,7 @@ pure logical function is_printable(c) character(len=1), intent(in) :: c !! The character to test. integer :: ic ic = iachar(c) ! '~' - is_printable = c >= ' ' .and. ic <= int(z'7E') + is_printable = ic >= iachar(' ') .and. ic <= int(z'7E') end function !> Checks whether `c` is a lowercase ASCII letter (a .. z). From 37f1d6c6ee0de7d99b26de1913761e56ac9bb3b0 Mon Sep 17 00:00:00 2001 From: Arjen Markus Date: Thu, 24 Sep 2020 21:00:35 +0200 Subject: [PATCH 3/4] Update src/stdlib_ascii.f90 Co-authored-by: Ian Giestas Pauli --- src/stdlib_ascii.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdlib_ascii.f90 b/src/stdlib_ascii.f90 index a95d2d254..67c40091b 100644 --- a/src/stdlib_ascii.f90 +++ b/src/stdlib_ascii.f90 @@ -153,7 +153,7 @@ pure logical function is_lower(c) character(len=1), intent(in) :: c !! The character to test. integer :: ic ic = iachar(c) - is_lower = (ic >= iachar('a')) .and. (ic <= iachar('z')) + is_lower = ic >= iachar('a') .and. ic <= iachar('z') end function !> Checks whether `c` is an uppercase ASCII letter (A .. Z). From a68430aa88529361cfa43c342fb4adc592130d96 Mon Sep 17 00:00:00 2001 From: Arjen Markus Date: Thu, 24 Sep 2020 21:01:18 +0200 Subject: [PATCH 4/4] Update src/stdlib_ascii.f90 Co-authored-by: Ian Giestas Pauli --- src/stdlib_ascii.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stdlib_ascii.f90 b/src/stdlib_ascii.f90 index 67c40091b..2bcfdfdc8 100644 --- a/src/stdlib_ascii.f90 +++ b/src/stdlib_ascii.f90 @@ -144,7 +144,8 @@ pure logical function is_graphical(c) pure logical function is_printable(c) character(len=1), intent(in) :: c !! The character to test. integer :: ic - ic = iachar(c) ! '~' + ic = iachar(c) + !The character is printable if it's between ' ' and '~' in the ASCII table is_printable = ic >= iachar(' ') .and. ic <= int(z'7E') end function