Rob Landley
e0ea4d4712
Rename/move xmemcmp() (which doesn't exit) to smemcmp(), and add x prefix
...
to notstdio() while there.
2023-01-06 19:05:51 -06:00
Rob Landley
50ed76deb2
Placate ASAN by replacing memcmp() with xmemcmp().
2022-12-26 12:02:05 -06:00
Rob Landley
664c417af5
Add lots of "static" annotations, make a couple things use FLAG() macros, etc.
2021-02-07 17:19:44 -06:00
Rob Landley
e9396994d3
Next round of shell work.
2020-05-03 23:15:35 -05:00
Rob Landley
e05d620a79
More shell plumbing. Redo of variable storage, add export.
2020-04-02 02:58:42 -05:00
Rob Landley
3b82917a49
Fix xclearenv() breakage pointed out by Derrick Pallas.
...
Toybox doesn't modify inherited environ[] (the same way we don't modify
our inherited argv[]), so instead of freeing our allocated environ[] when
we want to clear it we need to allocate a new environ[] in the else path
(at a length compatible with the existing plumbing's add stride), set the
first entry of _that_ to 0, and set toys.envc = 1 to record it's an
alloced environ.
2020-02-26 02:45:09 -06:00
Rob Landley
dd75e81e3d
The expand should expand.
2020-01-16 07:09:57 -06:00
Rob Landley
2c6b319f46
Only free the environment variables we didn't inherit from exec.
2020-01-03 20:17:16 -06:00
Rob Landley
953b23aad3
Next round of toysh work, with associated lib plumbing.
2019-12-12 22:02:35 -06:00
Rob Landley
121322285a
Add a couple comments.
2019-05-03 11:45:43 -05:00
Elliott Hughes
bd7c5c0555
env: fix case where a variable is replaced.
...
Found when trying to update the toybox prebuilt used for the Android
build.
Also add the corresponding test.
2019-05-03 11:35:59 -05:00
Rob Landley
543b2580c7
Add xunsetenv() for the error checking.
2019-04-20 03:05:07 -05:00
Rob Landley
71c3f623c6
New xsetenv() plumbing (repeatedly set same environment variables without
...
leaking memory), and mod env command to test it.
2019-04-20 02:51:51 -05:00