<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/testsuite/awk.tests, branch long_paths</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=long_paths</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=long_paths'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-07-10T10:54:23+00:00</updated>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2024-07-10T10:54:23+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-07-10T10:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2dc17b7c80c803119dd2214bce4406b252ae2e9f'/>
<id>urn:sha1:2dc17b7c80c803119dd2214bce4406b252ae2e9f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>awk: restore assignment precedence to be lower than ternary ?:</title>
<updated>2024-07-09T13:30:46+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2024-07-09T13:30:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=38335df9e9f45378c3407defd38b5b610578bdda'/>
<id>urn:sha1:38335df9e9f45378c3407defd38b5b610578bdda</id>
<content type='text'>
Something is fishy with constrcts like "3==v=3" in gawk,
they should not work, but do. Ignore those for now.

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2024-01-05T11:17:37+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-01-05T11:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=49edb26faaddb81e6333e7891715ce13301aed09'/>
<id>urn:sha1:49edb26faaddb81e6333e7891715ce13301aed09</id>
<content type='text'>
</content>
</entry>
<entry>
<title>awk: fix handling of empty fields</title>
<updated>2023-12-31T14:49:54+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-12-31T14:49:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=789ccac7d9d1a9e433570ac9628992a01f946643'/>
<id>urn:sha1:789ccac7d9d1a9e433570ac9628992a01f946643</id>
<content type='text'>
Patch by M Rubon &lt;rubonmtz@gmail.com&gt;:
Busybox awk handles references to empty (not provided in the input)
fields differently during the first line of input, as compared to
subsequent lines.

$ (echo a ; echo b) | awk '$2 != 0'    #wrong
b

No field $2 value is provided in the input.  When awk references field
$2 for the "a" line, it is seen to have a different behaviour than
when it is referenced for the "b" line.

Problem in BusyBox v1.36.1 embedded in OpenWrt 23.05.0
Same problem also in 21.02 versions of OpenWrt
Same problem in BusyBox v1.37.0.git

I get the correct expected output from Ubuntu gawk and Debian mawk,
and from my fix.
will@dev:~$ (echo a ; echo b) | awk '$2 != 0'  #correct
a
b
will@dev:~/busybox$ (echo a ; echo b ) | ./busybox awk '$2 != 0'  #fixed
a
b

I built and poked into the source code at editors/awk.c  The function
fsrealloc(int size) is core to allocating, initializing, reallocating,
and reinitializing fields, both real input line fields and imaginary
fields that the script references but do not exist in the input.

When fsrealloc() needs more field space than it has previously
allocated, it initializes those new fields differently than how they
are later reinitialized for the next input line.  This works fine for
fields defined in the input, like $1, but does not work the first time
when there is no input for that field (e.g. field $99)

My one-line fix simply makes the initialization and clrvar()
reinitialization use the same value for .type.  I am not sure if there
are regression tests to run, but I have not done those.

I'm not sure if I understand why clrvar() is not setting .type to a
default constant value, but in any case I have left that untouched.

function                                             old     new   delta
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0)                 Total: 0 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2023-06-16T12:02:47+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-06-16T12:02:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4b3d7e62cff6015e1c4b856165efd90cf9182a5c'/>
<id>urn:sha1:4b3d7e62cff6015e1c4b856165efd90cf9182a5c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>awk: fix subst code to handle "start of word" pattern correctly (needs REG_STARTEND)</title>
<updated>2023-06-08T08:42:39+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-06-08T08:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2ca39ffd447ca874fcea933194829717d5573247'/>
<id>urn:sha1:2ca39ffd447ca874fcea933194829717d5573247</id>
<content type='text'>
function                                             old     new   delta
awk_sub                                              637     714     +77

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>awk: fix backslash handling in sub() builtins</title>
<updated>2023-06-02T22:42:10+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-06-02T22:39:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5f84c5633663f6ee8c9cc3a4608b86d4b56b39d6'/>
<id>urn:sha1:5f84c5633663f6ee8c9cc3a4608b86d4b56b39d6</id>
<content type='text'>
function                                             old     new   delta
awk_sub                                              559     544     -15

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>awk: fix precedence of = relative to ==</title>
<updated>2023-05-30T14:44:04+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-05-30T14:42:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4'/>
<id>urn:sha1:0256e00a9d077588bd3a39f5a1ef7e2eaa2911e4</id>
<content type='text'>
Discovered while adding code to disallow assignments to non-lvalues

function                                             old     new   delta
parse_expr                                           936     991     +55
.rodata                                           105243  105247      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0)               Total: 59 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>awk: fix splitting with default FS</title>
<updated>2023-05-27T14:17:38+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-05-27T14:16:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=84ff1825dd82e8de45020e3def34d1430d8e5a99'/>
<id>urn:sha1:84ff1825dd82e8de45020e3def34d1430d8e5a99</id>
<content type='text'>
function                                             old     new   delta
awk_split                                            543     544      +1

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>awk: fix use-after-realloc (CVE-2021-42380), closes 15601</title>
<updated>2023-05-26T17:36:58+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-05-26T17:36:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5dcc443dba039b305a510c01883e9f34e42656ae'/>
<id>urn:sha1:5dcc443dba039b305a510c01883e9f34e42656ae</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
