<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/editors, branch path_search</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=path_search</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=path_search'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-02-16T12:06:15+00:00</updated>
<entry>
<title>build system: avoid full rebuild when EXTRAVERSION changes</title>
<updated>2024-02-16T12:06:15+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-02-16T12:06:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0200baa675d3b51c0f021da7728353ee7ceedba4'/>
<id>urn:sha1:0200baa675d3b51c0f021da7728353ee7ceedba4</id>
<content type='text'>
The last two commits allow EXTRAVERSION to track the current state
of a git repository.  The build system was unable to determine
which files were affected by changes to EXTRAVERSION and caused
a full rebuild when it changed.

Alter how the version information is passed to the code so only
a handful of files need to be rebuilt when it changes.
</content>
</entry>
<entry>
<title>awk: fix segfault when compiled by clang</title>
<updated>2024-01-19T15:19:49+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-01-19T15:19:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=042520e46621e434c9bd2da6b100b32ccdee55a5'/>
<id>urn:sha1:042520e46621e434c9bd2da6b100b32ccdee55a5</id>
<content type='text'>
A 32-bit build of BusyBox using clang segfaulted in the test
"awk assign while assign".  Specifically, on line 7 of the test
input where the adjustment of the L.v pointer when the Fields
array was reallocated:

   	L.v += Fields - old_Fields_ptr;

was out by 4 bytes.

Rearrange to code so both gcc and clang generate code that works.

This patch has been submitted upstream.  Until it's accepted there
the new code is only used in builds for Windows.
</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>sed: check errors writing file with sed -i</title>
<updated>2024-01-01T23:58:56+00:00</updated>
<author>
<name>Dominique Martinet</name>
<email>dominique.martinet@atmark-techno.com</email>
</author>
<published>2023-09-19T08:11:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5dc9ece3b9e87af0dcb01449821ac827391ac116'/>
<id>urn:sha1:5dc9ece3b9e87af0dcb01449821ac827391ac116</id>
<content type='text'>
sed would currently not error if write failed when modifying a file.

This can be reproduced with the following 'script':
$ sudo mount -t tmpfs tmpfs -o size=1M /tmp/m
$ sudo chmod 777 /tmp/m
$ echo foo &gt; /tmp/m/foo
$ dd if=/dev/zero of=/tmp/m/fill bs=4k
dd: error writing '/tmp/m/fill': No space left on device
256+0 records in
255+0 records out
1044480 bytes (1.0 MB, 1020 KiB) copied, 0.00234567 s, 445 MB/s
$ busybox sed -i -e 's/.*/bar/' /tmp/m/foo
$ echo $?
0
$ cat /tmp/m/foo
&lt;empty&gt;

new behaviour:
$ echo foo &gt; /tmp/m/foo
$ ./busybox sed -i -e 's/.*/bar/' /tmp/m/foo
sed: write error
$ echo $?
4
$ cat /tmp/m/foo
foo

function                                             old     new   delta
sed_main                                             754     801     +47
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 47/0)               Total: 47 bytes
   text	   data	    bss	    dec	    hex	filename
  75727	   2510	   1552	  79789	  137ad	busybox_old
  75774	   2510	   1552	  79836	  137dc	busybox_unstripped

Signed-off-by: Dominique Martinet &lt;dominique.martinet@atmark-techno.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</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-12-05T07:44:02+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-12-05T07:44:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=7dff7f37600209353cf4e86d1cca29bacf5f7372'/>
<id>urn:sha1:7dff7f37600209353cf4e86d1cca29bacf5f7372</id>
<content type='text'>
</content>
</entry>
<entry>
<title>awk: implement -E; do not reorder -f and -e</title>
<updated>2023-10-02T13:24:06+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-10-02T13:24:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=92ab29fcf04bc3ff3d3ad897f1c2463d8b8d1410'/>
<id>urn:sha1:92ab29fcf04bc3ff3d3ad897f1c2463d8b8d1410</id>
<content type='text'>
function                                             old     new   delta
awk_main                                             843     891     +48
next_input_file                                      243     261     +18
packed_usage                                       34631   34638      +7
.rodata                                           105391  105390      -1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 73/-1)              Total: 72 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>diff: more changes to --binary</title>
<updated>2023-08-06T11:40:17+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-08-06T11:40:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0342f258f74bde329cc98733a3b22196ca1b1bdb'/>
<id>urn:sha1:0342f258f74bde329cc98733a3b22196ca1b1bdb</id>
<content type='text'>
The changes introduced to support the --binary option gave incorrect
results when comparing files with CRLF line endings *without* the
--binary option present.

The code needs to keep track of the position within the file and is
confused by text mode.

As an alternative solution, always use binary mode but skip the CR
of a CRLF pair when the --binary option isn't used.  This gives
results matching GNU diff when comparing files with matching line
endings, with or without --binary.  When line endings differ the
results aren't always the same.

Costs 32 bytes in the 32-bit build, saves 16 in 64-bit.

(GitHub issue #348)
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2023-07-13T07:06:26+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-07-13T07:06:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=bd978d0256fd3a67de1a7dd54f1a37f9435be363'/>
<id>urn:sha1:bd978d0256fd3a67de1a7dd54f1a37f9435be363</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update applet size estimates</title>
<updated>2023-07-10T15:25:21+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-07-10T15:25:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5353df91cba7b397b9407701681708d0a1518df6'/>
<id>urn:sha1:5353df91cba7b397b9407701681708d0a1518df6</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
