aboutsummaryrefslogtreecommitdiff
path: root/testsuite (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2023-04-171-0/+4
|\
| * seq: fix yet another case of negative parameters not workingDenys Vlasenko2023-04-111-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seq: accept negative parametersDenys Vlasenko2023-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | function old new delta seq_main 429 476 +47 packed_usage 34557 34538 -19 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 47/-19) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2023-04-091-0/+6
|\|
| * find: implement -okDavid Leonard2023-03-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html -ok utility_name [argument ...] ; The -ok primary shall be equivalent to -exec, except that the use of a <plus-sign> to punctuate the end of the primary expression need not be supported, and find shall request affirmation of the invocation of utility_name using the current file as an argument by writing to standard error as described in the STDERR section. If the response on standard input is affirmative, the utility shall be invoked. Otherwise, the command shall not be invoked and the value of the -ok operand shall be false. function old new delta do_exec 438 517 +79 parse_params 1833 1845 +12 static.params 288 292 +4 .rodata 100771 100775 +4 packed_usage 34543 34541 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 99/-2) Total: 97 bytes Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: improve CRLF handling in readRon Yorston2023-02-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | Commit deae0c7bf3 (Skip carriage return in read builtin command) caused all CRs to be removed from input to the read builtin. Only remove CRs that are part of a CRLF pair. Adds 64-80 bytes. (GitHub issue #285)
* | ash: remove CRs from CRLF during field splittingRon Yorston2023-02-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit e371e46fa0 (shell: add \r to IFS) added '\r' to the IFS variable so field splitting would remove carriage returns. Rather than change IFS, remove CRs preceding LFs in regions being scanned for field splitting before IFS is applied. This prevents free-standing CRs from being removed. Costs 112-120 bytes. (GitHub issue #285)
* | ash,make: fix CRLF handlingRon Yorston2023-01-301-0/+6
| | | | | | | | | | | | | | Fix remove_cr() so it only removes CRs which are part of a CRLF pair, not every CR. Add a test case for the shell.
* | awk: CRLF handlingRon Yorston2023-01-301-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous efforts at handling DOS-style line endings in awk have included commits ee7e00dc5 and 1a3717342. The use of remove_cr() is unwise: - It's overzealous, removing all CRs, not just those in CRLF pairs. - Even if that were fixed awk reads input in chunks. There's a remote chance a CRLF might appear at a chunk boundary and be missed. remove_cr() will be fixed separately. In awk treat all data input as being in text mode. Skipping CRs in skip_spaces() is also flawed. Instead read scripts in text mode. Add a couple of test cases. One of these (awk backslash+CRLF eaten with no trace) fails without this patch.
* | Merge branch 'busybox' into mergeRon Yorston2023-01-053-19/+35
|\|
| * testsuite/sha1sum.tests: fix false positive failureDenys Vlasenko2023-01-021-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * testsuite/tree.tests: fix false positive failureDenys Vlasenko2023-01-021-18/+20
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * testsuite/mount.tests: accomodate umount failure seen on 5.18.0Denys Vlasenko2022-12-131-1/+13
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | make: fixes to test scriptRon Yorston2022-12-121-0/+3
| | | | | | | | | | | | | | | | Unset MAKEFLAGS in the test script so it works if it's run using a version of make that has options which pdpmake doesn't understand. Return $FAILCOUNT as the exit status so the number of failures can be reported.
* | make: changes to suffix substitution in macro expansionRon Yorston2022-11-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POSIX standard defines suffix substitution in macro expansion as taking the form: $(string1 [: subst1 =[ subst2 ]]) Since 'subst1' isn't bracketed a value must be supplied. Enforce this in POSIX mode. As a non-POSIX extension an empty 'subst1' is permitted with 'subst2' being added to all words unconditionally. If both 'subst1' and 'subst2' are empty the words are returned unchanged.
* | make: use correct test for valid macro nameRon Yorston2022-11-131-0/+13
| | | | | | | | | | The test for valid macro names in POSIX mode was incorrect: it shouldn't have allowed '-'.
* | make: fix typo in inference rule handlingRon Yorston2022-11-041-23/+24
| | | | | | | | | | | | | | A typo in the previous commit caused dyndep() to process inference rules incorrectly. This didn't affect the results of the test suite when extensions were allowed but it caused the test 'Inference rule with explicit rule for prerequisite' to fail in POSIX mode.
* | make: fixes to inference rulesRon Yorston2022-11-031-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 875 clarifies some aspects of inference rules. The crux of the issue is related to chained inference rules so it doesn't affect POSIX mode. The test makefile looks like this: .SUFFIXES: .a .b .c .a.c: @echo .a.c .b.c: @echo .b.c test.c: test.b test.a: test.b: The correct output is deemed to be '.a.c'. Additional complications are: - whether or not the prerequisite files are present; - the use of the suffixes '.a' and '.c' may result in the builtin inference rule '.c.a' being considered. In favourable circumstances pdpmake managed to give the correct result, in unfavourable it reported circular dependencies or segfaulted. Changes to fix these issues are: - When prerequisites are being recursively built the standard says: 'Upon recursion, each prerequisite shall become a target itself.' Follow this requirement. - At the end of make() the target being built should have its time (as represented by n_tim in struct name) updated when any action has been taken. - When dyndep() is looking for prerequisites it should: * skip candidates that are in the process of being built; * consider whether an explicit candidate is a target, not whether it has any commands associated with it. pdpmake now behaves similarly to GNU make when presented with makefiles like the above. bmake gives the incorrect output '.b.c'.
* | make: comments in macro expansions and command linesRon Yorston2022-11-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POSIX specification says: There are three kinds of comments: blank lines, empty lines, and a <number-sign> ('#') and all following characters up to the first unescaped <newline> character. Most implementations don't treat '#' in a macro expansion or a command line as the start of a comment. POSIX doesn't mention either of these exceptions. Permit the exceptions as a non-POSIX extension.
* | make: fix test for .WAIT so bmake passesRon Yorston2022-11-011-1/+1
| | | | | | | | | | Use $? instead of $^ in the test for .WAIT. bmake supports .WAIT but not $^.
* | make: different treatment for escaped NL in macro in commandRon Yorston2022-10-301-0/+13
| | | | | | | | | | | | | | Austin Group defect report 1549 has been accepted. It requires that an escaped newline inside a macro expansion in a command is replaced by a space. Other escaped newlines in commands are left in place, as before.
* | make: .NOTPARALLEL and .WAIT are special targetsRon Yorston2022-10-191-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 1437 has been accepted. It describes the special targets .NOTPARALLEL and .WAIT which are used to influence the behaviour of parallel builds. Since parallel builds aren't implemented in here they actually don't 't have much effect. - For completeness they're flagged as special targets. - .WAIT should be allowed as a prerequisite.
* | make: shell assignment is a POSIX 202X featureRon Yorston2022-10-181-11/+12
| | | | | | | | | | | | | | | | Austin Group defect report 337 has been accepted, thus making macro assignment from the output of a shell command (!=) a POSIX 202X feature. This was previously implemented as a non-POSIX extension.
* | make: support $+ and $^ as POSIX 202X featuresRon Yorston2022-10-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect reports 514 and 1520 have both been accepted. Together these introduce the internal macros $+ and $^: - $+ lists all prerequisites, with duplicates retained; - $^ lists all prerequisites, with duplicates removed. $^ had already been implemented as a non-POSIX extension, it now becomes a POSIX 202X extension. $+ has been added as a POSIX 202X extension. Neither of the above defect reports mentions how $? should handle duplicate prerequisites. In POSIX mode duplicates are retained. Removal of duplicates is implemented as a non-POSIX extension to match existing practice in other versions of make.
* | make: clarify output of testsRon Yorston2022-10-161-31/+31
| |
* | Merge branch 'busybox' into mergeRon Yorston2022-10-125-0/+160
|\|
| * xxd: add two more testcasesDenys Vlasenko2022-08-221-2/+16
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: without -p, stop at more than one whitespace, closes 14786Denys Vlasenko2022-08-221-0/+9
| | | | | | | | | | | | | | function old new delta xxd_main 888 1076 +188 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix sort -s -u, closes 14871Denys Vlasenko2022-07-291-0/+10
| | | | | | | | | | | | | | function old new delta sort_main 851 856 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix -k2M (wasn't skipping leading whitespace)Denys Vlasenko2022-07-291-0/+11
| | | | | | | | | | | | | | function old new delta compare_keys 848 862 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix use after free (CVE-2022-30065)Natanael Copa2022-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | fixes https://bugs.busybox.net/show_bug.cgi?id=14781 function old new delta evaluate 3343 3357 +14 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shaNNNsum: accept one-space "HASH FILENAME" format for -c, closes 14866Denys Vlasenko2022-07-111-0/+10
| | | | | | | | | | | | | | function old new delta md5_sha1_sum_main 496 501 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: new appletRoger Knecht2022-06-301-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the tree program to list directories and files in a tree structure. function old new delta tree_print - 343 +343 scandir64 - 330 +330 scandir - 330 +330 tree_main - 86 +86 .rodata 105150 105228 +78 packed_usage 34511 34557 +46 alphasort64 - 31 +31 alphasort - 31 +31 strcoll - 5 +5 applet_names 2801 2806 +5 applet_main 1616 1620 +4 applet_suid 101 102 +1 applet_install_loc 202 203 +1 ------------------------------------------------------------------------------ (add/remove: 11/0 grow/shrink: 6/0 up/down: 1291/0) Total: 1291 bytes Signed-off-by: Roger Knecht <rknecht@pm.me> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | make: new appletRon Yorston2022-08-011-0/+413
| | | | | | | | | | | | | | | | | | This is an experimental implementation of make for busybox-w32, based on my public domain POSIX make: https://frippery.org/make/ (GitHub issue #44)
* | Merge branch 'busybox' into mergeRon Yorston2022-05-121-0/+110
|\|
| * tsort: new appletDavid Leonard2022-05-021-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta tsort_main - 578 +578 .rodata 104884 104906 +22 applet_names 2759 2765 +6 applet_main 1596 1600 +4 packed_usage 34290 34288 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/1 up/down: 610/-2) Total: 608 bytes Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: better fix for empty environment variablesRon Yorston2022-05-051-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears the CRT and OS each have a copy of the environment. mingw_putenv() fools the CRT into accepting an empty environment variable by calling _putenv("V=0") then truncating the new value by hand. But _putenv() also updates the OS environment with the fake 'V=0' value. Commit 5b48ca53b (win32: pass NULL to spawnve, not environ) resulted in this fake value being used and hence empty variables getting the value '0'. - Add a call to SetEnvironmentVariable() in mingw_putenv() to update the OS environment. - Restore the use of NULL environment pointers in mingw_spawnvp(). - Add a test. (GitHub issue #250)
* | Merge busybox into mergeRon Yorston2022-02-091-0/+15
|\| | | | | | | | | | | | | | | Fix conflicts in reset and ash. Redefine the new safe_read_key() as a reference to read_key(). Disable SHA256_HWACCEL.
| * sed: fix handling of escaped delimiters in s/// replacementDenys Vlasenko2022-01-231-2/+7
| | | | | | | | | | | | | | function old new delta parse_regex_delim 111 140 +29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: fix handling of escaped delimiters in s/// search pattern, closes 14541Denys Vlasenko2022-01-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta copy_parsing_escapes 67 96 +29 parse_regex_delim 109 111 +2 get_address 213 215 +2 add_cmd 1176 1178 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 35/0) Total: 35 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2022-01-131-1/+11
|\| | | | | | | | | | | | | Fix merge conflicts in coreutils/ls.c and shell/ash.c. Update config files to turn off SHA1_HWACCEL. It uses non-portable assembler.
| * awk: input numbers are never octal or hex (only program consts can be)Denys Vlasenko2022-01-081-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta next_token 825 930 +105 getvar_i 114 129 +15 nextchar 49 53 +4 my_strtod 138 - -138 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 3/0 up/down: 124/-138) Total: -14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2022-01-062-0/+51
|\| | | | | | | | | | | Fix merge conflict in miscutils/less.c. Use exit_SUCCESS() where possible.
| * sort: support -hDenys Vlasenko2022-01-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta static.scale_suffix - 62 +62 .rodata 104304 104336 +32 compare_keys 820 848 +28 packed_usage 34159 34184 +25 static.suffix - 9 +9 sort_opt_str 37 38 +1 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/0 up/down: 157/0) Total: 157 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix -s -r interaction: 'stable' order is not affected by -rDenys Vlasenko2022-01-041-0/+13
| | | | | | | | | | | | | | function old new delta compare_keys 818 820 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: correctly handle 'w FILE' commands writing to the same fileDenys Vlasenko2022-01-041-0/+9
| | | | | | | | | | | | | | function old new delta sed_xfopen_w - 84 +84 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2021-12-273-0/+30
|\| | | | | | | Fix merge conflict in coreutils/timeout.c.
| * sed: do not ignore 'g' modifier when match starts with ^Dominique Martinet2021-12-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is perfectly valid to start a regex with ^ and have other patterns with \| that can match more than once, e.g. the following example should print ca, as illustrated with gnu sed: $ echo 'abca' | sed -e 's/^a\|b//g' ca busybox before patch: $ echo 'abca' | busybox sed -e 's/^a\|b//g' bca busybox after patch: $ echo 'abca' | ./busybox sed -e 's/^a\|b//g' ca regcomp handles ^ perfectly well as illustrated with the second 'a' that did not match in the example, we ca leave the non-repeating to it if appropriate. The check had been added before using regcomp and was required at the time (f36635cec6da) but no longer makes sense now. (tested with glibc and musl libc) function old new delta add_cmd 1189 1176 -13 Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * printf: allow 0 as a flag and allow multiple flagsRon Yorston2021-12-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '%' character in a format specification may be followed by one or more flags from the list "+- #0". BusyBox printf didn't support the '0' flag or allow multiple flags to be provided. As a result the formats '%0*d' and '%0 d' were considered to be invalid. The lack of support for '0' was pointed out by Andrew Snyder on the musl mailing list: https://www.openwall.com/lists/musl/2021/12/14/2 function old new delta printf_main 860 891 +31 .rodata 99281 99282 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 32/0) Total: 32 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: code shrink in des encryption, in setup_salt()Denys Vlasenko2021-11-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | function old new delta pw_encrypt 978 971 -7 .rodata 108208 108192 -16 des_crypt 1211 1181 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-53) Total: -53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>