Repository navigation
What's Changed
-
shell-array:
- Added a new module providing a dense, zero-based array library on top of ordinary shell variables: shell_array_append, shell_array_set, shell_array_get, shell_array_pop and shell_array_unset. An array named A keeps its element count in the variable A and its elements in A0 through AN-1; operations never leak stale contents of unset slots. No external utilities are used and no forks occur per element.
-
shell-git-config:
- Fixed indented comment lines being parsed as variables. Git treats any leading whitespace as ignorable, so an indented comment line in a git config file was previously reported as a variable named
# indented commentwith value 'true' and rewritten as a literal# indented comment = trueline by git_config_set, git_config_append and git_config_list. Indented comments and indented sections are now recognized just like git does and survive rewrites verbatim.
- Fixed indented comment lines being parsed as variables. Git treats any leading whitespace as ignorable, so an indented comment line in a git config file was previously reported as a variable named
-
shell-config:
- Fixed shell_config_set failing to create a missing file when given a bare relative name, e.g. shell_config_set conf k v. The writability check used the file name itself instead of the current directory and rejected the call with "conf: not writable."
-
shell-bitwise:
- Fixed toggle_bits failing on non-bash shells due to a stray bash-only printf -v statement at the top of the function.
- Fixed fill_mask, set_bits, clear_bits and toggle_bits overwriting the caller's variable when the result was requested in a variable named m, p, n, number or __res: temporary variables are now named after their function to avoid such collisions.
-
shell-json:
- Fixed escaped backslashes being treated as escaping the following character, so that a valid document like {"p":"abc\"} failed with an unfinished string error. Escapes are now tracked explicitly and consumed once.
- Fixed the parser accepting malformed documents such as
[1,],{"a":},[1 2]and1., ignoring trailing garbage and accepting incomplete numbers and invalid string escapes. The parser now requires one complete top-level value, enforces container separators, validates number and string syntax, and preserves newlines as token boundaries; CRLF is accepted as whitespace outside of strings.
-
shell-string:
- Optimized character-by-character iteration over a string. The shell type is now probed once instead of on every iteration, the dash/ash walker no longer builds a full '?'-mask up front and gets each character by trimming it off the line, and fill_mask is built by a bit-doubling construction instead of a quadratic chunk-by-chunk copy.
-
shell-ip-address:
- Optimized ipv4_ptonx and ipv6_ptonx. Formatted output now uses builtin hex-digit lookups and the echo builtin instead of forking an external printf per octet (or per 16-bit group): 10 to 100 times faster on shells without a builtin printf. Output format is unchanged.
-
shell-var:
- Optimized shell_var_trim. Leading and trailing whitespace is now removed by parameter expansions instead of peeling one character at a time in a loop: 4.7x faster on dash, 6.0x on bash and 7.9x on mksh.
-
mans:
- Rewrote all 22 shell-* reference pages against the current sources so that they match the actual behaviour of the functions, and added per-function examples that were checked against the running module.
Full Changelog: v0.5.0...v0.6.0