Skip to content

Commit

Permalink
[libc][z/OS] Remove ASCII trick to fix EBDIC std::from_char (llvm#116078
Browse files Browse the repository at this point in the history
)

This PR will fix the following lit in all EBCDIC variations on z/OS:
`std/utilities/charconv/charconv.from.chars/floating_point.pass.cpp`

The trick to test for `e` and `E` is working only in ASCII.
The fix is to simply test for both lower and upper case exponent letter
`e` and `E` respectfully.
  • Loading branch information
zibi2 authored Nov 13, 2024
1 parent 62441b9 commit e25e886
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libc/src/__support/high_precision_decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ class HighPrecisionDecimal {
if (!saw_dot)
this->decimal_point = total_digits;

if (num_cur < num_len && ((num_string[num_cur] | 32) == 'e')) {
if (num_cur < num_len &&
(num_string[num_cur] == 'e' || num_string[num_cur] == 'E')) {
++num_cur;
if (isdigit(num_string[num_cur]) || num_string[num_cur] == '+' ||
num_string[num_cur] == '-') {
Expand Down

0 comments on commit e25e886

Please sign in to comment.