diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2026-02-28 07:24:24 +0200 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2026-02-28 07:24:24 +0200 |
| commit | bac9dd29ea2542dd8b7e84d2ccaa88179921f25f (patch) | |
| tree | d99bd4cf77866bcdfac9fdd56e68e73563ae81f6 | |
| parent | c30c879ed3db8b733c3841ae6c1d364fd366ad8e (diff) | |
bin/u8: Fix byte splitting and variable chaining
Turns out I encountered this issue five years ago and reported it.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257702
Closes #2
| -rwxr-xr-x | bin/u8 | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -23,8 +23,8 @@ # SOFTWARE. # -LC_ALL=C -a=$1 b=${a#?} c=${b#?} d=${c#?} +export LC_ALL=C +a=$1; b=${a#?}; c=${b#?}; d=${c#?} a=${a%"$b"} b=${b%"$c"} c=${c%"$d"} d=${d%"${1#????}"} export $(printf 'a=%d b=%d c=%d d=%d' "'$a" "'$b" "'$c" "'$d") printf '0x%08X\n' "$((a < 128 ? a : a < 224 ? |