Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Oct 25, 2024
1 parent 056f424 commit d11e46a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ main()
local shell_is_msys shell_exe shell_exe_original date_timezone_bug limits limits_date limits_u limits_rnd_u _max _num last_random_val tmp_var
local shell_info shell_name shell_applet os_info is_win shell_bit os_bit cpu_bit
local shell_test_bit shell_arithmetic_bit shell_printf_bit shell_printf_signed_bit shell_printf_unsigned_bit shell_printf_max_u shell_random_seed_bit
local awk_printf_bit awk_printf_signed_bit awk_printf_unsigned_bit date_bit date_u_bit
local awk_printf_bit awk_printf_signed_bit awk_printf_unsigned_bit cut_b_bit date_bit date_u_bit

shell_is_msys="${1}"
date_timezone_bug='false'
Expand Down Expand Up @@ -1123,6 +1123,19 @@ main()
done
awk_printf_unsigned_bit="$(convert_max_unsigned_int_to_bit "${_max}")" || awk_printf_unsigned_bit='unknown'

_max='-1'
for _num in ${limits}; do
if tmp_var="$(: | cut 2> /dev/null -b "${_num}")"; then
_max="${_num}"
else
if _num="$(inc_num "${_max}")" && tmp_var="$(: | cut 2> /dev/null -b "${_num}")"; then
printf '%s\n' 'ERROR: Detection of cut -b was inconclusive, please report it to the author!!!'
fi
break
fi
done
cut_b_bit="$(convert_max_signed_int_to_bit "${_max}")" || cut_b_bit='unknown'

_max='-1'
for _num in ${limits_date}; do
if tmp_var="$(TZ='CET-1' date 2> /dev/null -d "@${_num}" -- '+%s')" && test "${tmp_var}" = "${_num}"; then
Expand Down Expand Up @@ -1173,6 +1186,8 @@ main()
printf '%s\n' "Bits of awk 'printf' - signed: ${awk_printf_signed_bit}"
printf '%s\n\n' "Bits of awk 'printf' - unsigned: ${awk_printf_unsigned_bit}"

printf '%s\n\n' "Bits of 'cut -b': ${cut_b_bit}"

printf '%s %s\n' "Version of date:" "$(get_version 'date' || :)"
printf '%s%s\n' "Bits of 'TZ=CET-1 date' timestamp: ${date_bit}" "$(test "${date_timezone_bug}" = 'false' || printf ' %s\n' '(with time zone BUG)' || :)"
printf '%s\n' "Bits of 'date -u' timestamp: ${date_u_bit}"
Expand Down

0 comments on commit d11e46a

Please sign in to comment.