Age | Commit message (Collapse) | Author |
|
Fix memory leaks in regex. Simplify regex check (if we matched, subexpression
had to match). Don't exit() from a command, set exitval and return.
|
|
|
|
|
|
The tests/*.test files shouldn't explicitly exit, because they are
sourced in scripts/test.sh. No tests after sed were being run.
|
|
eliminate syntax_error() function (just call error_exit() directly),
eliminate advance() wrapper, pipe expected error messages in test to /dev/null
|
|
All tests pass now; this fixes the 2 remaining failures, including a
segfault.
The structure of the code has changed a lot -- instead of having a tiny
function per operator, we have eval_op() which does common type coercion
and then evaluates the operator. I tried writing it a couple different
ways, and this was the cleanest.
The OPS table now contains the operator string, precedence level,
signature for type coercion, and operator ID.
|
|
expr now uses the precedence table specified by POSIX, implemented using
the "precedence climbing" algorithm. See the references at the top of
eval_expr().
This fixes 3 of 4 failing tests.
I also added more tests for correct behavior and for syntax errors.
This includes a new test exposing a segfault, related to type coercion.
|
|
|
|
Found by afl-fuzz.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELinux denials include hex-encoded paths in the log messages; xxd -r -p is
a convenient way to decode them.
The heuristics are a little weird to my mind, but match the documentation
and observed behavior.
|
|
It uses a sed expression that assumes you can escape - to use it as a literal
(you can't, it has to be first or last char of the range), and assumes
you have to escape delimiters in sed [] context (you don't), and/or that
non-printf escapes become the literal character (they don't, the backslash
is preserved as a literal), meaning it winds up doing "s/[\-\]//" which is
a length 1 range, which is officially undefined behavior according to posix,
and regcomp errors out.
But if we don't accept it (like other implementations do) the perl build
breaks. So collapse [A-A] into just [A].
Testcae taken from perl 5.22.0 file Makefile.SH line 8.
(While we're at it, remove an unused argument from a function.)
|
|
|
|
Pathnames may be longer than the name field in the header, so use
strncpy() instead of xstrncpy() to avoid bailing out.
Also add unit tests to ensure proper handling of short and long
pathnames.
Change-Id: Id025891993746889564b479e5185cf9721b54a55
|
|
Don't rely on ordering of readdir for tests.
Change-Id: Ice24bb64ce453acb0006e3746677d619db933ab1
|
|
|
|
|
|
|
|
|
|
|
|
"cat /proc/self/exe && cmp /proc/self/exe" won't see the same file if cat
and cmp aren't both in a toybox multiplexer binary, so snapshot and pick one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Includes tests for the new feature, and a failure case for the minimal
perms test as well.
Also some typo fixing / massaging the help text so it fits in 80
columns.
|
|
Even though ext2 has a comment that it has to be at the start, I added swap
to the start of the array (oops). The test suite was also wrong (it was
matching the _incorrect_ output).
|
|
|
|
1) It read st_dev instead of st_mode.
2) It reversed the semantics of absolute vs minimal ('-' prefixed) tests.
Add tests for these, and move the "unterminated -exec" test into the "Still
fails" section because it's still dumping core for me.
|
|
Four-digit years were being mangled by the code for two-digit years.
Move all the two-digit year code into the "we only saw two digits" case.
Add some new tests and fix existing tests.
|
|
|
|
This lets '(x)\1' match, as reported by Isabella Parakiss.
|
|
an extra newline because the test for whether we have an existing string to
append a newline to was checking if struct step had data appended to it,
and the /x/ regex is data appended to it. Change test to check for null
terminator at ->arg1 offset.
|
|
|
|
Elliott Hughes found a bug https://android-review.googlesource.com/#/c/170020/
and Daniel K. Levy worked out the problem: the user/group/newer arguments
to find weren't consuming their arguments when not checking the results of
their comparison (because an earlier test had already caused their
parenthetical group to fail). This confused the argument parsing logic
and could lead to segfaults.
I applied a different fix that reorganized the existing tests instead of
adding a new test. (Looks like a big commit but it's mostly whitespace
due to extra curly brackets changing indendentation levels.)
|
|
and update the tests.
|
|
|
|
Rounds correctly via brute force, displayed digits are decimal even when
working with powers of 2, shows at most 3 significant (decimal) digits.
(So no "1023M" nonsense, that's 1.0G.)
|