Compare commits

...
31 Commits
Author SHA1 Message Date
Denys Vlasenko 1dd2685dcc Bump version to 1.30.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 15:25:41 +01:00
Rostislav Skudnov c199472e3a chcon: Fix typo in ACTION_RECURSE
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko d7a622b572 lineedit: fix SEGV in isk, hexedit, ed, closes 11661
fdisk, hexedit and ed calls read_line_edit in libbb/lineedit.c with NULL
as first argument. On line 2373 of lineedit.c of busybox version 1.29.3,
state->hist_file is referenced without checking the state->flag.

This causes segmentation fault on fdisk, hexedit and ed on ARM Cortex-A9.
It somehow works on x86_64.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Ari Sundholm 256ee62224 grep: fix -x -v with certain pattern orders
We found out that busybox -x -v is a bit broken:

ari@ari-thinkpad:~/busybox$ echo '  aa bb cc' | ./busybox grep -x -e 'aa.*' -e '.*bb.*'
  aa bb cc
ari@ari-thinkpad:~/busybox$ echo '  aa bb cc' | ./busybox grep -x -v -e 'aa.*' -e '.*bb.*'
ari@ari-thinkpad:~/busybox$ echo '  aa bb cc' | ./busybox grep -x -e '.*aa.*' -e 'bb.*'
  aa bb cc
ari@ari-thinkpad:~/busybox$ echo '  aa bb cc' | ./busybox grep -x -v -e '.*aa.*' -e 'bb.*'
  aa bb cc

Last one is wrong.

This patch fixes the issue by making sure that the variable 'found'
never makes a transition from 1 to 0, as this would mean that
grep previously found a match on this input line.

Signed-off-by: Ari Sundholm <ari@tuxera.com>
Signed-off-by: Niko Vähäsarja <niko@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 5c6b9165e7 bc: implement pass-by-reference code from upstream
function                                             old     new   delta
zxc_program_popResultAndCopyToVar                    298     493    +195
bc_vec_pushIndex                                       -      75     +75
zxc_vm_process                                       859     928     +69
xc_program_dereference                                 -      66     +66
bc_vec_npush                                           -      65     +65
zbc_num_s                                            239     249     +10
zxc_program_num                                     1024    1032      +8
zbc_num_divmod                                       150     156      +6
xc_program_search                                    143     146      +3
zxc_program_assign                                   392     389      -3
zdc_program_execStr                                  520     517      -3
xc_program_pushVar                                   198     195      -3
zxc_program_exec                                    4101    4092      -9
zbc_program_call                                     318     308     -10
zbc_func_insert                                      120     104     -16
zbc_parse_stmt_possibly_auto                        1460    1439     -21
bc_vec_push                                           53      12     -41
xc_parse_pushIndex                                    61      18     -43
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 6/9 up/down: 497/-149)          Total: 348 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Bernhard Reutner-Fischer 8296334c1f ip link: Fix vlan proto, closes 8261 and 11638
The proto has to be passed in network byte-order.
While at it allow for
 ip link add link eth0 name eth0.2.24 type vlan proto 802.1ad id 24
 ip link del link eth0 name eth0.2.24 type vlan proto 802.1ad id 24
The del was lacking a dev_str and thus errored out. Fix by using
name/dev counterpart as fallback.

The proto identifier 802.1Q was not recognized, just it's lowercase
variant, fix that too.

function                                             old     new   delta
do_add_or_delete                                    1275    1376    +101
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 101/0)             Total: 101 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 7f8f20714a ip link: fix mismatched enums in vlan_parse_opt(), closes 11631
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Brian Foley b65db51ac1 sed: Fix backslash parsing for 'w' command arg
If there's any whitespace between w and the filename, parse_file_cmd
writes to the wrong offset when trying to fix up backslashes.

This can be seen in the asan build with busybox sed -e 'w 0\\'

Signed-off-by: Brian Foley <bpfoley@google.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Mark Marshall fa86b27e24 capability: fix string comparison in cap_name_to_number
The result of strcasecmp was being used incorrectly.  This function
returns 0 if the strings match.

Signed-off-by: Mark Marshall <mark.marshall@omicronenergy.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko b570954363 bc: code shrink
function                                             old     new   delta
xc_parse_pushInst_and_Index                            -      16     +16
zbc_parse_expr                                      1818    1816      -2
xc_parse_pushIndex                                    65      61      -4
zbc_parse_pushSTR                                     63      58      -5
zbc_parse_name                                       448     442      -6
xc_parse_pushNUM                                      74      67      -7
zdc_parse_expr                                       479     470      -9
bc_parse_pushJUMP_ZERO                                21      12      -9
bc_parse_pushJUMP                                     21      12      -9
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/8 up/down: 16/-51)            Total: -35 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko c28dc0b58b bc: remove "empty expression" check/message, parsing fails in these cases anyway
function                                             old     new   delta
zbc_parse_expr                                      1848    1818     -30

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 60fb586597 bc: zbc_parse_expr_empty_ok() is unused except by zbc_parse_expr(), fold it in
function                                             old     new   delta
zbc_parse_expr                                      1865    1848     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 715273a992 bc: disallow invalid syntax like "{ print 1 print 2 }"
statement parsing must NOT eat the terminator: caller needs to know
what it was, to correctly decide whether it is a valid one.

function                                             old     new   delta
zxc_program_read                                       -     234    +234
zdc_program_printStream                                -     144    +144
zbc_parse_stmt_possibly_auto                        1413    1460     +47
zxc_vm_process                                       869     859     -10
zxc_program_exec                                    4116    4101     -15
zdc_program_asciify                                  368       -    -368
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/2 up/down: 425/-393)           Total: 32 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Martijn Dekker a89ec68a8a ls: make -i compatible with coreutils: don't follow symlink by default
Signed-off-by: Martijn Dekker <martijn@inlv.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 5cea086bbf bc: shorten "limits" output
text	   data	    bss	    dec	    hex	filename
 979016	    485	   7296	 986797	  f0ead	busybox_old
 978959	    485	   7296	 986740	  f0e74	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 9c36a02f4d bc: formatting changes, added a FIXME comment, no logic changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 5b35d599e8 bc: support void functions (GNU compat)
function                                             old     new   delta
xc_program_print                                       -     689    +689
zxc_vm_process                                       814     869     +55
zxc_program_exec                                    4098    4116     +18
zxc_program_assign                                   385     392      +7
bc_result_free                                        43      46      +3
zxc_program_binOpPrep                                243     245      +2
zdc_program_execStr                                  518     520      +2
zxc_program_print                                    683       -    -683
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 6/0 up/down: 776/-683)           Total: 93 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko c7679c759a dc: fit returning of string
function                                             old     new   delta
zxc_program_exec                                    4087    4098     +11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko d2651fb775 dc: fix '?'
function                                             old     new   delta
zdc_parse_expr                                       470     479      +9
zxc_vm_process                                       839     814     -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 9/-25)             Total: -16 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko fb001145e1 bc: eliminate struct BcInstPtr::results_len_before_call, it is redundant
function                                             old     new   delta
zbc_program_call                                     332     318     -14
zxc_program_exec                                    4147    4087     -60
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-74)             Total: -74 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko ef2e6a8062 bc: add a palceholder comment for "void" return
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko f40467d369 bc: remove extra div/0 test, remove test for string function parameter
function                                             old     new   delta
zbc_program_call                                     354     332     -22
zxc_program_assign                                   426     385     -41
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-63)             Total: -63 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 56e09e93bd bc: fix "...; return}" to work, disallow "return ()"
function                                             old     new   delta
zbc_parse_expr                                        24    1865   +1841
zbc_parse_stmt_possibly_auto                        1425    1413     -12
bc_parse_expr_empty_ok                              1843       -   -1843
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 1841/-1855)        Total: -14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 18351b4a89 bc: make error line number also size_t, like everything else
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko a8ec556458 bc: generate large bc tests on the fly, -5 mbytes in the git tree
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 7dd6ba12f7 bc: speed up string printing, fix print ""
function                                             old     new   delta
static.esc                                             -       9      +9
zxc_program_print                                    681     683      +2
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 11/0)               Total: 11 bytes
   text	   data	    bss	    dec	    hex	filename
 979144	    485	   7296	 986925	  f0f2d	busybox_old
 979062	    485	   7296	 986843	  f0edb	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko f23c04af2d bc: upstream fixes
function                                             old     new   delta
bc_parse_expr_empty_ok                              1764    1843     +79
bc_error_at                                            -      62     +62
bc_parse_inst_isLeaf                                   -      30     +30
zbc_func_insert                                      100     120     +20
bc_error_bad_function_definition                       -      10     +10
bc_error_bad_assignment                                -      10     +10
zxc_lex_next                                        1608    1614      +6
ok_in_expr                                            30       -     -30
zxc_vm_process                                       874     839     -35
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 3/1 up/down: 217/-65)           Total: 152 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko c3de036da9 bc: in xc_read_line(), check ^C on NUL input bytes too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 2123ceed18 bc: remove superfluous assigment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 8a7411fcc8 bc: support ibase up to 36 (GNU compat)
function                                             old     new   delta
zxc_program_num                                      995    1018     +23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
Denys Vlasenko 07c8b240d5 bc: fold xc_lex_more_input() into peek_inbuf()
function                                             old     new   delta
peek_inbuf                                            69      56     -13

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-14 14:40:57 +01:00
16 changed files with 958 additions and 418 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 30
SUBLEVEL = 0
SUBLEVEL = 1
EXTRAVERSION =
NAME = Unnamed
+2 -2
View File
@@ -1204,8 +1204,8 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
nfiles = 0;
do {
cur = my_stat(*argv, *argv,
/* follow links on command line unless -l, -s or -F: */
!(option_mask32 & (OPT_l|OPT_s|OPT_F))
/* follow links on command line unless -l, -i, -s or -F: */
!(option_mask32 & (OPT_l|OPT_i|OPT_s|OPT_F))
/* ... or if -H: */
|| (option_mask32 & OPT_H)
/* ... or if -L, but my_stat always follows links if -L */
+1 -1
View File
@@ -387,7 +387,7 @@ static int parse_file_cmd(/*sed_cmd_t *sed_cmd,*/ const char *filecmdstr, char *
bb_error_msg_and_die("empty filename");
*retval = xstrndup(filecmdstr+start, idx-start+hack+1);
if (hack)
(*retval)[idx] = '\\';
(*retval)[idx-start] = '\\';
return idx;
}
+1 -1
View File
@@ -404,7 +404,7 @@ static int grep_file(FILE *file)
#endif
) {
if (option_mask32 & OPT_x) {
found = (gl->matched_range.rm_so == 0
found |= (gl->matched_range.rm_so == 0
&& match_at[gl->matched_range.rm_eo] == '\0');
} else
if (!(option_mask32 & OPT_w)) {
+1 -1
View File
@@ -67,7 +67,7 @@ unsigned FAST_FUNC cap_name_to_number(const char *cap)
goto found;
}
for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
if (strcasecmp(capabilities[i], cap) != 0)
if (strcasecmp(capabilities[i], cap) == 0)
goto found;
}
bb_error_msg_and_die("unknown capability '%s'", cap);
+5 -4
View File
@@ -2383,13 +2383,14 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
timeout = st->timeout;
}
#if MAX_HISTORY > 0
if (state->flags & DO_HISTORY) {
# if ENABLE_FEATURE_EDITING_SAVEHISTORY
if (state->hist_file)
if (state->cnt_history == 0)
load_history(state);
if (state->hist_file)
if (state->cnt_history == 0)
load_history(state);
# endif
if (state->flags & DO_HISTORY)
state->cur_history = state->cnt_history;
}
#endif
/* prepare before init handlers */
+506 -387
View File
File diff suppressed because it is too large. Load diff
+12 -6
View File
@@ -490,11 +490,11 @@ static void vlan_parse_opt(char **argv, struct nlmsghdr *n, unsigned int size)
;
enum {
ARG_id = 0,
ARG_protocol,
ARG_reorder_hdr,
ARG_gvrp,
ARG_mvrp,
ARG_loose_binding,
ARG_protocol,
};
enum {
PROTO_8021Q = 0,
@@ -518,11 +518,11 @@ static void vlan_parse_opt(char **argv, struct nlmsghdr *n, unsigned int size)
id = get_u16(*argv, "id");
addattr_l(n, size, IFLA_VLAN_ID, &id, sizeof(id));
} else if (arg == ARG_protocol) {
arg = index_in_substrings(protocols, *argv);
arg = index_in_substrings(protocols, str_tolower(*argv));
if (arg == PROTO_8021Q)
proto = ETH_P_8021Q;
proto = htons(ETH_P_8021Q);
else if (arg == PROTO_8021AD)
proto = ETH_P_8021AD;
proto = htons(ETH_P_8021AD);
else
bb_error_msg_and_die("unknown VLAN encapsulation protocol '%s'",
*argv);
@@ -673,13 +673,19 @@ static int do_add_or_delete(char **argv, const unsigned rtm)
linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
}
/* Allow "ip link add dev" and "ip link add name" */
if (!name_str)
name_str = dev_str;
else if (!dev_str)
dev_str = name_str;
/* else if (!strcmp(name_str, dev_str))
name_str = dev_str; */
if (rtm != RTM_NEWLINK) {
if (!dev_str)
return 1; /* Need a device to delete */
req.i.ifi_index = xll_name_to_index(dev_str);
} else {
if (!name_str)
name_str = dev_str;
if (link_str) {
int idx = xll_name_to_index(link_str);
addattr_l(&req.n, sizeof(req), IFLA_LINK, &idx, 4);
+1 -1
View File
@@ -204,7 +204,7 @@ int chcon_main(int argc UNUSED_PARAM, char **argv)
fname[fname_len] = '\0';
if (recursive_action(fname,
((option_mask32 & OPT_RECURSIVE) ? ACTION_RECURSIVE : 0),
((option_mask32 & OPT_RECURSIVE) ? ACTION_RECURSE : 0),
change_filedir_context,
change_filedir_context,
NULL, 0) != TRUE)
+92 -11
View File
@@ -103,16 +103,43 @@ testing "bc for (;;) {break}" \
"2\n9\n" \
"" "for (;;) {2;break}; 9"
testing "bc define {return}" \
"bc" \
"0\n9\n" \
"" "define w() {return}\nw();9"
testing "bc define auto" \
"bc" \
"8\n9\n" \
"" "define w() { auto z; return 8; }; w(); 9"
testing "bc define auto array same name" \
"bc" \
"8\n9\n" \
"" "define w(x) { auto x[]; return x; }; w(8); 9"
testing "bc define with body on next line" \
"bc" \
"8\n9\n" \
"" "define w()\n{ auto z; return 8; }\nw()\n9"
testing "bc void function" \
"bc" \
"void9\n" \
"" "define void w() {print \"void\"}\nw()\n9"
# Extra POSIX compat - GNU bc does not allow this
testing "bc function named 'void'" \
"bc" \
"void0\n9\n" \
"" "define void() {print \"void\"}\nvoid()\n9"
# Extra POSIX compat - GNU bc does not allow this
testing "bc variable named 'void'" \
"bc" \
"6\n9\n" \
"" "void=6\nvoid\n9"
testing "bc if(cond)<NL>" \
"bc" \
"9\n" \
@@ -133,6 +160,23 @@ testing "bc ifz does not match if keyword" \
"1\n2\n2\n3\n" \
"" "ifz=1;ifz\n++ifz;ifz++\nifz"
# had parse error on "f()-N"
testing "bc -l 'e(0)-2'" \
"bc -l" \
"-1.00000000000000000000\n" \
"" "e(0)-2"
testing "bc (!a&&b)" \
"bc" \
"0\n" \
"" "(!a&&b)"
# check that dc code is not messing this up (no NUL printing!)
testing "bc print \"\"" \
"bc" \
"" \
"" "print \"\""
testing "bc print 1,2,3" \
"bc" \
"123" \
@@ -186,17 +230,17 @@ testing "bc continue in if" \
"" "\
i=2
while(i--) {
11
if(i) {
21
continue
22
} else {
31
continue
32
11
if(i) {
21
continue
22
} else {
31
continue
32
}
12
12
}
99
"
@@ -218,7 +262,44 @@ for(i=1; i<3; i++) {
99
"
tar xJf bc_large.tar.xz
testing "bc ibase" \
"bc" \
"99\n1295\n1224\n" \
"" "a=ZZ;a;ibase=36;a=ZZ;a;ibase=Z;a=ZZ;a"
testing "bc parsing of numbers" \
"bc 2>&1 | bc 2>&1 | md5sum 2>&1" \
"465d8c01308d0863b6f5669e8a1c69fb -\n" \
"" '
for (b = 2; b <= 16; ++b) {
if (b == 10) continue
obase = 10
print "ibase = A; ibase = ", b, "\n"
obase = b
for (i = 0; i <= 65536; ++i) {
i
print "0.", i, "\n"
print "1.", i, "\n"
print i, ".", i, "\n"
}
}'
testing "bc printing of numbers" \
"bc 2>&1 | bc 2>&1 | md5sum 2>&1" \
"d884b35d251ca096410712743aeafb9e -\n" \
"" '
for (b = 2; b <= 101; ++b) {
if (b == 10) continue
s = b * b
print "obase = ", b, "\n"
for (i = 0; i <= s; ++i) {
i
print "0.", i, "\n"
print "1.", i, "\n"
print i, ".", i, "\n"
}
2189432174861923048671023498128347619023487610234689172304.192748960128745108927461089237469018723460
}'
for f in bc*.bc; do
r="`basename "$f" .bc`_results.txt"
Binary file not shown.
+1 -3
View File
@@ -4,9 +4,7 @@ define x(x) {
define y() {
return;
}
define z() {
return ();
}
define z() {return}
scale = 0
x=2
x[0]=3
+106
View File
@@ -0,0 +1,106 @@
define printarray(a[], len) {
auto i
for (i = 0; i < len; ++i) {
a[i]
}
}
define a2(a[], len) {
auto i
for (i = 0; i < len; ++i) {
a[i] = a[i] * a[i]
}
printarray(a[], len)
}
define a4(a__[], len) {
auto i
for (i = 0; i < len; ++i) {
a__[i] = a__[i] * a__[i]
}
printarray(a__[], len)
}
define a6(*a__[], len) {
auto i
for (i = 0; i < len; ++i) {
a__[i] = a__[i] * a__[i]
}
printarray(a__[], len)
}
define a1(*a[], len) {
auto i
for (i = 0; i < len; ++i) {
a[i] = i
}
a2(a[], len)
printarray(a[], len)
}
define a3(*a__[], len) {
auto i
for (i = 0; i < len; ++i) {
a__[i] = i
}
a4(a__[], len)
printarray(a__[], len)
}
define a5(*a__[], len) {
auto i
for (i = 0; i < len; ++i) {
a__[i] = i
}
a2(a__[], len)
printarray(a__[], len)
}
define a7(*a__[], len) {
auto i
for (i = 0; i < len; ++i) {
a__[i] = i
}
a6(a__[], len)
printarray(a__[], len)
}
len = 16
a1(a[], len)
printarray(a[], len)
a3(a[], len)
printarray(a[], len)
a5(a[], len)
printarray(a[], len)
a7(a[], len)
printarray(a[], len)
halt
+212
View File
@@ -0,0 +1,212 @@
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
0
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
0
0
1
4
9
16
25
36
49
64
81
100
121
144
169
196
225
0
+10
View File
@@ -41,6 +41,16 @@ testing "dc complex without spaces (multiple args)" \
"16\n" \
"" ""
testing "dc read" \
"dc -finput" \
"2\n9\n1\n" \
"1?2\nf" "9\n"
testing "dc read string" \
"dc -finput" \
"2\nstr\n1\n" \
"1?2\nf" "[str]\n"
optional FEATURE_DC_BIG
# All tests below depend on FEATURE_DC_BIG
+7
View File
@@ -177,6 +177,13 @@ testing "grep -w word match second word" \
"bword,word\n""wordb,word\n""bwordb,word\n" \
""
testing "grep -x -v -e EXP1 -e EXP2 finds nothing if either EXP matches" \
"grep -x -v -e '.*aa.*' -e 'bb.*'; echo \$?" \
"1\n" \
"" \
" aa bb cc\n"
# -r on symlink to dir should recurse into dir
mkdir -p grep.testdir/foo
echo bar > grep.testdir/foo/file