Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Nov 1, 2024
1 parent 6fc870f commit 1d6cd96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1369,13 +1369,12 @@ init_cmdline()
}

if test "${DO_INIT_CMDLINE:-0}" != '0'; then
set -u
# shellcheck disable=SC3040,SC3041,SC2015 # Ignore: In POSIX sh, set option xxx is undefined. / In POSIX sh, set flag -X is undefined. / C may run when A is true.
{
# Unsupported set options may cause the shell to exit (even without set -e), so first try them in a subshell to avoid this issue
(set 2> /dev/null -o pipefail) && set -o pipefail || true
(set 2> /dev/null +H) && set +H || true
}
set -u 2> /dev/null || :

# shellcheck disable=SC3040 # Ignore: In POSIX sh, set option pipefail is undefined
case "$(set 2> /dev/null -o || set || :)" in *'pipefail'*) set -o pipefail || printf 1>&2 '%s\n' 'Failed: pipefail' ;; *) ;; esac
# shellcheck disable=SC3041,SC2015 # Ignore: In POSIX sh, set flag -H is undefined
(set +H 2> /dev/null) && set +H || :
fi

# Set environment variables
Expand Down
4 changes: 2 additions & 2 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ SCRIPT_VERSION='1.5.18'
### CONFIGURATION ###

set -u 2> /dev/null || :

# shellcheck disable=SC3040 # Ignore: In POSIX sh, set option pipefail is undefined
case "$(set 2> /dev/null -o || set || :)" in *'pipefail'*) set -o pipefail || printf 1>&2 '%s\n' 'Failed: pipefail' ;; *) ;; esac
case "$(set 2> /dev/null -o || set || :)" in *'monitor'*) set +m || printf 1>&2 '%s\n' 'Failed: monitor' ;; *) ;; esac

# The "obosh" shell does NOT support "command" while the "posh" shell does NOT support "type"
{
Expand Down Expand Up @@ -1243,7 +1243,7 @@ main()
case "${cut_version}" in
# The "cut" of "GNU textutils 1.5" does NOT freeze (so no timeout needed) but shells that come with this old "cut" may NOT support background processes
*'GNU textutils'*) _max="$(detect_bits_of_cut_b "${limits_s_u}" "${operative_system}")" || _max='-1' ;;
*) _max="$(code_timeout 3>&2 2>/dev/null detect_bits_of_cut_b 8 "${limits_s_u}" "${operative_system}")" || _max='-1' ;;
*) _max="$(code_timeout 3>&2 2> /dev/null detect_bits_of_cut_b 8 "${limits_s_u}" "${operative_system}")" || _max='-1' ;;
esac
cut_b_bit="$(convert_max_unsigned_int_to_bit "${_max}" 'true' || :)"

Expand Down

0 comments on commit 1d6cd96

Please sign in to comment.