Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(1) fails to properly handle leading zeroes on integers #527

Open
heatd opened this issue Nov 3, 2024 · 2 comments
Open

test(1) fails to properly handle leading zeroes on integers #527

heatd opened this issue Nov 3, 2024 · 2 comments

Comments

@heatd
Copy link

heatd commented Nov 3, 2024

Example problem ('test' = GNU coreutils):

$ umask
0022
$ test $(umask) -eq 22
$ echo $?
0
$ toybox test $(umask) -eq 22
$ echo $?
1

This breaks xz's configure script, which thinks there's no POSIX shell because of this.
https://github.com/tukaani-project/xz/blob/dbca3d078ec581600600abebbb18769d3d713914/m4/posix-shell.m4#L36-L38

Not sure what the proper fix here is. Should leading 0's be interpreted as octal?

@heatd
Copy link
Author

heatd commented Nov 3, 2024

Actually, I'm more confused... 'test' should be dash/bash's builtin, but it seems to fail transparently on my toybox-as-utils system... I'll need to look into this, please disregard for a while

@heatd
Copy link
Author

heatd commented Nov 3, 2024

Alright, my problem was unrelated, but this still seems to not be implemented correctly in toybox anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant