Re: Applet who usage information

2012-04-18 Thread Ron Yorston
Denys, On Thu, Apr 5, 2012 at 2:58 AM, ra...@gmx.de ra...@gmx.de wrote: the who applet has an option -H to display the column headers, but this option is not displayed in the usage information. Is this intentional or missing? Fixed in git, thanks! There's a typo in the fix. s/-a/-H/ Ron

[PATCH] mktemp: fix -u option if TMPDIR is set

2012-09-20 Thread Ron Yorston
temp.XX /tmp/temp.8gP6Pq $ export TMPDIR=/tmp $ mktemp -u temp.XX mp/temp.BuEBHM Signed-off-by: Ron Yorston r...@tigress.co.uk --- debianutils/mktemp.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c index dbe4309

Re: [PATCH] mktemp: fix -u option if TMPDIR is set

2012-09-20 Thread Ron Yorston
walter harms wha...@bfs.de wrote: I can no reproduce that. What libc you are using ? glibc 2.13 What mktemp ? (busybox or others ? if Busybox what version ?) BusyBox, built from git master as of commit 3c62bba (ushcpc: gracefully handle packets with CHECKSUM_PARTIAL). Ron

Re: [PATCH] V2 mktemp: fix -u option if TMPDIR is set

2012-09-20 Thread Ron Yorston
Tito farmat...@tiscali.it wrote: This seems to work for me as expected eventually needs more testing. It doesn't work correctly in this case: $ mktemp -t -p /var/tmp -u temp.XX /var/tmp/temp.Jj1aWI $ export TMPDIR=/tmp $ mktemp -t -p /var/tmp -u temp.XX /tmp/temp.h8I9ly

Re: [PATCH] V2 mktemp: fix -u option if TMPDIR is set

2012-09-20 Thread Ron Yorston
Tito farmat...@tiscali.it wrote: Seems to work like debian's mktemp with my patch applied, maybe needs more testing.. debian:~$ cd Desktop/busybox debian:~/Desktop/busybox$ mktemp -t -p /var/tmp -u temp.XX /var/tmp/temp.D0pKak debian:~/Desktop/busybox$ export TMPDIR=/tmp

Re: [PATCH] V2 mktemp: fix -u option if TMPDIR is set

2012-09-21 Thread Ron Yorston
Ron Yorston r...@tigress.co.uk wrote: Tito farmat...@tiscali.it wrote: Seems to work like debian's mktemp with my patch applied, maybe needs more testing.. debian:~$ cd Desktop/busybox debian:~/Desktop/busybox$ mktemp -t -p /var/tmp -u temp.XX /var/tmp/temp.D0pKak debian:~/Desktop/busybox

[PATCH] mktemp: make -u option work more like coreutils

2012-09-21 Thread Ron Yorston
temp.Fi7Zgh /tmp/temp.2Hi55L /tmp/temp.oQLmgi temp123.rCzPdM temp123.tUqsBg t/temp.21IcyP t/temp.cgeAmg tmpdir/temp.FV5FxO tmpdir/temp.VJW19j /var/tmp/temp.E45xYO /var/tmp/temp.sYHyok Signed-off-by: Ron Yorston r...@tigress.co.uk

[PATCH] vi: fix adjustment of buffer on partial file read

2013-03-07 Thread Ron Yorston
The second argument to text_hole_delete was incorrect: it should be a pointer to the end of the hole. Signed-off-by: Ron Yorston r...@tigress.co.uk --- editors/vi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editors/vi.c b/editors/vi.c index 7173415..3d6182b 100644

SHLVL in ash

2014-01-02 Thread Ron Yorston
I've just been having a look at 1.22.0. I note that BusyBox ash doesn't export SHLVL. If whatever invokes ash doesn't have SHLVL set or doesn't have it exported each new shell has a SHLVL of 1: [rmy@f14vm busybox]$ cp busybox sh [rmy@f14vm busybox]$ unset SHLVL [rmy@f14vm busybox]$

Re: SHLVL in ash

2014-01-02 Thread Ron Yorston
Mike Frysinger wrote: correct. busybox knows nothing of SHLVL. it's just another env var to busybox. so if you set/export/whatever it, then busybox will pass it along unmodified. In 1.22.0 BusyBox ash does (conditionally) know about SHLVL: #if ENABLE_ASH_BASH_COMPAT p =

[PATCH] date: fix incorrect year in dates of the form [[[MM]DD]hh]mm

2014-01-20 Thread Ron Yorston
Since commit 688a7e3f dates of the form [[[MM]DD]hh]mm have the wrong year: $ ./busybox date -d 10101010 Fri Oct 10 10:10:00 GMT 10102910 Signed-off-by: Ron Yorston r...@tigress.co.uk --- libbb/time.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libbb/time.c

[PATCH] od: print valid octal values with -c flag

2014-03-20 Thread Ron Yorston
# coreutils 000 302 243 \n 003 Signed-off-by: Ron Yorston r...@tigress.co.uk --- coreutils/od_bloaty.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 2c26dda..337d132 100644 --- a/coreutils/od_bloaty.c

[PATCH] Use chomp to remove newlines

2014-04-27 Thread Ron Yorston
/remove: 0/0 grow/shrink: 0/6 up/down: 0/-50) Total: -50 bytes Signed-off-by: Ron Yorston r...@tigress.co.uk --- libbb/get_line_from_file.c | 3 +-- networking/netstat.c | 2 +- printutils/lpd.c | 2 +- procps/powertop.c | 6 +++--- util-linux/hwclock.c | 2

[PATCH 1/2] vi: avoid spurious error if no filename is provided

2014-08-18 Thread Ron Yorston
(and hence open) from being called with a null filename. Signed-off-by: Ron Yorston r...@tigress.co.uk --- editors/vi.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/editors/vi.c b/editors/vi.c index 24a9f60..9f55af1 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -722,7

[PATCH 2/2] vi: fix reading of file after last line

2014-08-18 Thread Ron Yorston
point is normally at the start of the line following the specified line. When the specified line is the last one the next_line function baulks at moving to the non-existent following line. Signed-off-by: Ron Yorston r...@tigress.co.uk --- editors/vi.c |6 +- 1 files changed, 5 insertions

Re: [PATCH 1/2] vi: avoid spurious error if no filename is provided

2014-08-18 Thread Ron Yorston
Laszlo Papp wrote: Do you know under which circumstances it happens? Is this a regression or does it require some special environment? (I cannot reproduce it here with v1.20.2) It's a regression on the master branch. The commit is dated 2014-04-05. The problem isn't present in 1.20.2. Ron

Re: `busyboxvi` is not working like before

2014-10-19 Thread Ron Yorston
busybox git build running `./busybox vi` now shows '(null)' Bad address instead of - No file 1/1 100% like before. I submitted a patch for that in August: http://lists.busybox.net/pipermail/busybox/2014-August/081534.html and `./busybox vi new.txt` now shows 'new.txt' No such file or

Re: `busyboxvi` is not working like before

2014-10-19 Thread Ron Yorston
Steven Honeyman wrote: *sigh* another one for the list Well, I don't like to make a fuss but three other patches I submitted this year have had no response: http://lists.busybox.net/pipermail/busybox/2014-March/080654.html http://lists.busybox.net/pipermail/busybox/2014-April/080811.html

Re: [PATCHv2] Use sendfile to copy data between file descriptors

2014-10-21 Thread Ron Yorston
Well, this is fortuitous. From the kernel mailing list: From: Pieter Smith pie...@boesman.nl Subject: [PATCH 2/2] fs: Support compiling out sendfile Date: Mon, 20 Oct 2014 23:48:37 +0200 Many embedded systems will not need this syscall, and omitting it saves space. Add a new EXPERT config

[PATCH 1/2] vi: failure to open file is not an error when initialising buffer

2014-11-30 Thread Ron Yorston
or directory instead of - new.txt 1/1 100% Signed-off-by: Ron Yorston r...@tigress.co.uk --- editors/vi.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/editors/vi.c b/editors/vi.c index 70bdbab..7b88e8e 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -542,9

[PATCH 2/2] vi: fix reading of file after last line

2014-11-30 Thread Ron Yorston
point is normally at the start of the line following the specified line. When the specified line is the last one the next_line function baulks at moving to the non-existent following line. Signed-off-by: Ron Yorston r...@tigress.co.uk --- editors/vi.c | 6 +- 1 file changed, 5 insertions(+), 1

[PATCH] dpkg: update supported compression methods

2014-12-07 Thread Ron Yorston
According to the deb(5) man page the tar files contained in a deb file can be compressed as follows: control.tar: uncompressed, gz, xz data.tar: uncompressed, gz, bz2, lzma, xz Signed-off-by: Ron Yorston r...@tigress.co.uk --- archival/dpkg.c | 12

[PATCH] lineedit: don't block when looking for escape sequence in vi-mode

2014-12-12 Thread Ron Yorston
When in vi-mode lineedit tries to detect some escape sequences. After an escape it reads the next character to check for certain values. This read should have a timeout or a user-entered ESC to switch to command mode doesn't properly handle the next character. Signed-off-by: Ron Yorston r

Re: control-c

2015-01-28 Thread Ron Yorston
m...@grounded.net wrote: I fire up either a cmd or power shell in windows 7. I start 'busybox bash' and get into a shell. I run a script then can never kill it unless I close the powershell window. How do I kill this process if control-c won't work? Not easily. Signals in Windows are

[PATCH] ash: do not split the result of tilde expansion

2015-03-16 Thread Ron Yorston
=834629283f6c629a4da05ef60bae9445c954a19a Signed-off-by: Ron Yorston r...@tigress.co.uk --- shell/ash.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index 0f9f73e..b568013 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -5791,7 +5791,6 @@ exptilde

Re: prompt display when cd to dir symoblic link

2015-04-02 Thread Ron Yorston
Harald Becker wrote: ... but I can't find the location in BB ash.c, where this \w is replaced with the directory name :( ... (any hint?) libbb/lineedit.c Ron ___ busybox mailing list busybox@busybox.net

Re: prompt display when cd to dir symoblic link

2015-04-02 Thread Ron Yorston
Harald Becker wrote: As the code for this prompt display has got moved into libbb, it has no more access to the value of ash's curdir variable ... using getcwd to get the value to display. Another similar case I've encountered is with the home directory. The shell respects HOME in performing

Re: [PATCH] libbb: remove unnecessary argument to nonblock_immune_read

2015-04-20 Thread Ron Yorston
walter harms wha...@bfs.de wrote: just for my curiosity: if only ash uses this function should why it is in libbb ? Only ash calls it directly. It's also called from xmalloc_reads which is called by patch, mail, lpd and acpid. Ron ___ busybox mailing

[PATCH] libbb: remove unnecessary argument to nonblock_immune_read

2015-04-19 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@tigress.co.uk --- include/libbb.h | 2 +- libbb/read_printf.c | 8 shell/ash.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index 0f8363b..21da5f1 100644 --- a/include/libbb.h +++ b

[PATCH 6/7] ash: move parse-time quote flag detection to run-time

2015-05-15 Thread Ron Yorston
by Herbert Xu Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 164 1 file changed, 66 insertions(+), 98 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index 33a477d..e7e7081 100644 --- a/shell/ash.c +++ b/shell/ash.c

[PATCH 5/7] ash: remove arithmetic expansion collapsing at parse time

2015-05-15 Thread Ron Yorston
/utils/dash/dash.git by Herbert Xu Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index ee7642a..33a477d 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -11316,9 +11316,9

[PATCH 7/7] ash: fix breakage of ${v/pat/str} and shrink code

2015-05-15 Thread Ron Yorston
-- (add/remove: 0/0 grow/shrink: 1/1 up/down: 46/-77)Total: -31 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 78 + 1 file changed, 26 insertions(+), 52 deletions(-) diff --git a/shell/ash.c b/shell/ash.c

[PATCH 3/7] ash: do not expand tilde in parameter expansion within quotes

2015-05-15 Thread Ron Yorston
Test case: unset a echo ${a:-~root} Old result: /root New result: ~root Based on commit 170f44d from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions

[PATCH 2/7] ash: perform tilde expansion in all parameter expansion words

2015-05-15 Thread Ron Yorston
Previously tilde expansion was not carried out for =?#% expansion words. Test case: a=~root:~root echo ${a#~root} Old result: /root:/root New result: :/root Based on commit dd721f71 from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu Signed-off-by: Ron Yorston r

[PATCH 1/7] ash: code shrink around varvalue

2015-05-15 Thread Ron Yorston
767 -86 -- (add/remove: 0/0 grow/shrink: 1/1 up/down: 35/-86)Total: -51 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 84

[PATCH 4/7] ash: remove superfluous code in arithmetic mode

2015-05-15 Thread Ron Yorston
Based on commits 1a74845, cfc3d6a and ff13779 from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index d87166c..ee7642a

[PATCH 0/7] ash: various fixes from dash

2015-05-15 Thread Ron Yorston
The following patch series is an attempt to fix a report that this doesn't work in BusyBox ash: test='/dir/file.ext' echo ${test##*[/|\\]} test='\dir\file.ext' echo ${test##*[/|\\]} In both cases the result should be 'file.ext' but in fact the test strings are returned unchanged.

[PATCH 7/7 v2] ash: fix breakage of ${v/pat/str} and shrink code

2015-05-15 Thread Ron Yorston
-- (add/remove: 0/0 grow/shrink: 2/1 up/down: 41/-71)Total: -30 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 79 ++--- 1 file changed

Re: [PATCH 7/7] ash: fix breakage of ${v/pat/str} and shrink code

2015-05-15 Thread Ron Yorston
Ron Yorston wrote: Fix this and revise the code so that the different handling of the pattern and the replacement string takes place in rmescapes rather than the separate function parse_sub_pattern. Well, this is embarrassing. My fix for the breakage ended up breaking even more stuff. Watch

[PATCH] testsuite: add some tests for ash

2015-05-15 Thread Ron Yorston
--- testsuite/ash/ash-do-not-collapse-arithmetic-expansion-at-parse-time | 1 + testsuite/ash/ash-do-not-expand-tilde-in-parameter-expansion-in-quotes | 1 + .../ash-do-not-quote-backslashes-in-parameter-expansions-outside-quotes | 1 + testsuite/ash/ash-expand-tilde-in-parameter-expansion

[PATCH] which: search applet table in standalone shell mode

2015-05-29 Thread Ron Yorston
bytes Signed-off-by: Ron Yorston r...@pobox.com --- debianutils/which.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/debianutils/which.c b/debianutils/which.c index d50e7a0..c00453b 100644 --- a/debianutils/which.c +++ b/debianutils/which.c @@ -16,6 +16,7 @@ //usage: /bin

[PATCH] lineedit: search applets as well as PATH for tab completion

2015-05-29 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@pobox.com --- libbb/lineedit.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index a83e07c..2ddb2b6 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -47,7 +47,8 @@ * It stems from

[PATCH] lineedit: skip non-executables when tab-completing commands

2015-05-29 Thread Ron Yorston
Of course, on *nix systems there are probably very few non-executables in directories on PATH. Signed-off-by: Ron Yorston r...@pobox.com --- libbb/lineedit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 2ddb2b6..1fd0dbc 100644 --- a/libbb

[PATCH] busybox: alter help message in standalone shell mode

2015-05-30 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@pobox.com --- libbb/appletlib.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 46849e4..2fd3adc 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -642,10 +642,19 @@ static int busybox_main(char

[PATCH 1/2] ash: remove parsebackquote flag

2015-07-01 Thread Ron Yorston
/shrink: 0/1 up/down: 0/-41) Total: -41 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 8 +--- shell/ash_test/ash-misc/tickquote1.right | 1 + shell/ash_test/ash-misc/tickquote1.tests | 1 + 3 files changed, 3 insertions(+), 7

[PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-01 Thread Ron Yorston
readtoken1 31823116 -66 -- (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-66) Total: -66 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 36

Re: [PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-02 Thread Ron Yorston
Rich Felker wrote: In general alloca is unsafe. It's not obvious to me what the code here is doing, so I can't tell for sure if it's safe or not, but I think this needs a strong justification of safety before being acceptable. It's a parser for a POSIXy shell, I doubt that the code is obvious to

Re: [PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-02 Thread Ron Yorston
Bernd Petrovitsch wrote: Since (GNU-)C99 is used: What about variable length arrays instead of alloca? I haven't looked at the code of gcc but I understand that it allocates VLAs on the stack, so they'd be subject to the same limits as alloca. Ron ___

[PATCH] less: further tweaks to regular file detection

2015-07-31 Thread Ron Yorston
. Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/miscutils/less.c b/miscutils/less.c index be8d20e..7a441bf 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -615,11 +615,12 @@ static int

[PATCH 4/5] ash: respect -p flag when command builtin is run with -v/-V

2015-08-03 Thread Ron Yorston
-- (add/remove: 0/0 grow/shrink: 3/0 up/down: 30/0) Total: 30 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 12 shell/ash_test/ash-misc/command.right | 1 + shell/ash_test/ash-misc/command.tests | 1 + 3 files

[PATCH 3/5] ash: fix command -- crash

2015-08-03 Thread Ron Yorston
13681350 -18 -- (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-18) Total: -18 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 4 ++-- 1 file changed, 2

[PATCH 1/5] ash: allow newline after variable name in for loop

2015-08-03 Thread Ron Yorston
15681563 -5 -- (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5) Total: -5 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 4 ++-- shell/ash_test/ash

[PATCH 0/5] Some more fixes to ash

2015-08-03 Thread Ron Yorston
This patch series harvests some more fixes from dash. These are all quite small: the overall effect is an additional 12 bytes of bloat. I've included tests where appropriate. Ron ___ busybox mailing list busybox@busybox.net

[PATCH 5/5] ash: fix error during recursive processing of here document

2015-08-03 Thread Ron Yorston
190 203 +13 -- (add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 5 +++-- shell/ash_test

[PATCH] less: fix botched attempt to use last column

2015-08-04 Thread Ron Yorston
`=`. There are two other places where buffers are created without allowing for width+1 characters. Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/miscutils/less.c b/miscutils/less.c

[PATCH] ash: allow popredir to be called if the stack is empty

2015-08-10 Thread Ron Yorston
fails when the stack is empty. Reported-by: Bastian Bittorf bitt...@bluebottle.com Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index db6fb8f..ebe8a4e 100644 --- a/shell/ash.c +++ b/shell/ash.c

Re: [PATCH v2] less: improvements to verbose status messages

2015-07-21 Thread Ron Yorston
walter harms wrote: +while ((len=safe_read(fd, buf, 4096)) 0) { sorry for being late of that .. with sizeof(buf) instead of 4096 you can modify buf[] only ... Noted, thank you. I really should get into the habit of doing that. Ron ___

Re: [PATCH v2] less: improvements to verbose status messages

2015-07-22 Thread Ron Yorston
Ron Yorston wrote: Better, though, might be to put the test in open_file_and_read_lines, where all input files are opened. This would prevent read_lines from trying to read non-regular files. Actually, my concern that read_lines might react badly to being fed /dev/zero was misplaced. read_lines

[PATCH] less: fix numeric input

2015-07-21 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miscutils/less.c b/miscutils/less.c index 90c1038..d6c921d1 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -1259,7 +1259,7 @@ static void number_process(int

Re: [PATCH v2] less: improvements to verbose status messages

2015-07-21 Thread Ron Yorston
Denys Vlasenko wrote: I added code to only do a reading pass if the file is a regular file: think about less /dev/SOMETHING. If the file can't be opened or isn't regular num_lines should be set to something other than READING_FILE (READING_STDIN would do, or some other negative value). Otherwise

Re: [PATCH 1/2] Revert ash: use alloca to get rid of setjmp

2015-07-22 Thread Ron Yorston
Xabier Oneca wrote: I'm not an expert, but why not just use plain ol' malloc? That's what the code in question did originally. This is in the shell parser which is recursive and has to allow errors to propagate upwards. The code in this case had setjmp/longjmp calls to avoid leaking allocated

Re: [PATCH v2] less: improvements to verbose status messages

2015-07-22 Thread Ron Yorston
Ron Yorston wrote: I still think it would be better to detect non-regular files earlier and I'll put together a patch for that. Well, it didn't turn out to be as clear-cut as I'd hoped. Patch follows: take it or leave it. Ron ___ busybox mailing list

[PATCH] less: rearrange detection of non-regular files

2015-07-22 Thread Ron Yorston
409 379 -30 -- (add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-30) Total: 18 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 21

[PATCH 1/5] less: move code to count lines into a separate function

2015-07-24 Thread Ron Yorston
-- (add/remove: 1/0 grow/shrink: 0/1 up/down: 159/-143) Total: 16 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 52 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/miscutils/less.c b/miscutils

[PATCH 0/5] More fixes to less

2015-07-24 Thread Ron Yorston
This patch series supersedes two of my recent patches to less that haven't been committed. It also adds a whole lot more. The overall bloat introduced by the series is: function old new delta update_num_lines

[PATCH 3/5] less: add a function to detect when display is at end of file

2015-07-24 Thread Ron Yorston
319 264 -55 -- (add/remove: 1/0 grow/shrink: 0/3 up/down: 63/-112) Total: -49 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 25

[PATCH 2/5] less: rearrange detection of non-regular files

2015-07-24 Thread Ron Yorston
-- (add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-32) Total: 16 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/miscutils/less.c b/miscutils/less.c index

[PATCH 5/5] less: allow use of last column of terminal

2015-07-24 Thread Ron Yorston
-- (add/remove: 0/0 grow/shrink: 1/0 up/down: 6/0) Total: 6 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/miscutils/less.c b/miscutils/less.c index f34b817

[PATCH 4/5] less: fix line number confusion

2015-07-24 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 121 ++- 1 file changed, 83 insertions(+), 38 deletions(-) diff --git a/miscutils/less.c b/miscutils/less.c index 3e37794..f34b817 100644 --- a/miscutils/less.c +++ b/miscutils/less.c

[PATCH 2/2] libbb: add a function to make a copy of a region of memory

2015-07-16 Thread Ron Yorston
)Total: -46 bytes Signed-off-by: Ron Yorston r...@pobox.com --- include/libbb.h | 1 + libbb/procps.c | 3 +-- libbb/xfuncs_printf.c | 5 + miscutils/last_fancy.c | 4 ++-- networking/traceroute.c | 11 +-- networking/udhcp

[PATCH 1/2] Revert ash: use alloca to get rid of setjmp

2015-07-16 Thread Ron Yorston
This reverts commit 072fc60f29ee3a4ff38f095a9ef149b2e820c8c0. Use of alloca is considered unsafe. Signed-off-by: Ron Yorston r...@pobox.com --- shell/ash.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index

Re: [PATCH 2/2] ash: use alloca to get rid of setjmp

2015-07-16 Thread Ron Yorston
Rich Felker wrote: I suspect it can easily be made to do arbitrary code execution when otherwise-safe (e.g. checked against whitelist for special chars) strings from untrusted input are expanded inside eval commands. Any new use of VLA/alloca should be completely banned. It's basically always an

old_e2fsprogs

2015-07-16 Thread Ron Yorston
Is there any reason to keep the old_e2fsprogs directory around? Ron ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox

[PATCH] less: fix display of line numbers

2015-07-18 Thread Ron Yorston
-- (add/remove: 0/1 grow/shrink: 1/1 up/down: 9/-117) Total: -108 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions

Re: [PATCH] less: fix display of line numbers

2015-07-18 Thread Ron Yorston
walter harms wrote: you can remove the else if you turn the compare on its head. may be this helps so save a few bytes. It doesn't make any difference to the binary though it does make the source a bit tidier. +if (n 999 MAXLINES 999) { could you explain in 1 line why the

[PATCH v2] less: fix display of line numbers

2015-07-18 Thread Ron Yorston
-- (add/remove: 0/1 grow/shrink: 1/1 up/down: 9/-117) Total: -108 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 35 +++ 1 file changed, 11 insertions(+), 24 deletions(-) diff

[PATCH] less: document -S flag and make it independently configurable

2015-07-19 Thread Ron Yorston
156077 +32 packed_usage 30223 30244 +21 -- (add/remove: 0/0 grow/shrink: 2/0 up/down: 53/0) Total: 53 bytes Signed-off-by: Ron Yorston r...@pobox.com

[PATCH] less: correctly account for tabs when rewrapping lines

2015-07-19 Thread Ron Yorston
and gets tab stops right, but it does cause lines to be wrapped at the wrong position. Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miscutils/less.c b/miscutils/less.c index 7c46ba5..90c1038 100644

[PATCH] ipcalc: fix trivial usage message

2015-07-12 Thread Ron Yorston
Signed-off-by: Ron Yorston r...@pobox.com --- networking/ipcalc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/networking/ipcalc.c b/networking/ipcalc.c index 3c8b8bf..f4bacd7 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c @@ -13,7 +13,8 @@ */ //usage

[PATCH] less: improvements to verbose status messages

2015-07-21 Thread Ron Yorston
-- (add/remove: 1/0 grow/shrink: 4/1 up/down: 232/-32) Total: 200 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 73 +--- 1 file changed, 59 insertions(+), 14 deletions

Re: [PATCH] less: improvements to verbose status messages

2015-07-21 Thread Ron Yorston
Xabier Oneca -- xOneca wrote: You should break from 'while' too (using evil goto?). No need to continue reading the file if you don't want count MAXLINES (in fact, in your code, count will be incremented past MAXLINES in the next read). Good catch, thank you. I'm looking at it now: a goto

[PATCH v2] less: improvements to verbose status messages

2015-07-21 Thread Ron Yorston
-- (add/remove: 1/0 grow/shrink: 4/1 up/down: 232/-32) Total: 200 bytes Signed-off-by: Ron Yorston r...@pobox.com --- miscutils/less.c | 74 +--- 1 file changed, 60 insertions(+), 14 deletions

[PATCH] libiproute: use if_nametoindex

2015-10-21 Thread Ron Yorston
Saves 87 bytes. Assuming, of course, all platforms have it. Signed-off-by: Ron Yorston <r...@pobox.com> --- networking/libiproute/ll_map.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/networking/libiproute/ll_map.c b/networking/libi

[PATCH 3/3] ash: simplify EOF/newline handling in list parser

2015-10-29 Thread Ron Yorston
ub/scm/utils/dash/dash.git) Reported-by: Natanael Copa <nc...@alpinelinux.org> Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash.c | 63 - 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/shell/ash.c b

[PATCH 1.24.1] ash: backport fix for here document issues

2015-10-29 Thread Ron Yorston
Reported-by: Natanael Copa <nc...@alpinelinux.org> Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash.c | 72 +-- shell/ash_test/ash-heredoc/heredoc2.right | 2 + shell/ash_test/ash-heredoc/heredoc2.tests | 7 +++ 3 f

[PATCH 1/3] ash: add test for issue with here document

2015-10-29 Thread Ron Yorston
This used to work but doesn't now: foo () { cat < Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash_test/ash-heredoc/heredoc2.right | 2 ++ shell/ash_test/ash-heredoc/heredoc2.tests | 7 +++ 2 files changed, 9 insertions(+) create mode 100644 shell/ash_test/ash-heredoc

Re: [PATCH 2/3] Revert "ash: fix a SEGV case in an invalid heredoc" xxx

2015-10-29 Thread Ron Yorston
Natanael Copa wrote: >I think this will not work. peektoken and nexttoken_ends_lists are not >same thing. Originally peektoken in Busybox ash was the same as in dash. It then changed to effectively act as nexttoken_ends_lists but the name was retained until Denys's patch. Reverting that patch

Re: [PATCH 3/3] ash: simplify EOF/newline handling in list parser

2015-10-29 Thread Ron Yorston
Natanael Copa wrote: >you forgot the last hunk in Herbert Xu's patch. Not forgotten, omitted. It wasn't clear to me that removing the reinitialisation of those variables was safe so I left it in. Ron ___ busybox mailing list busybox@busybox.net

Re: [PATCH 1.24.1] ash: backport fix for here document issues

2015-10-29 Thread Ron Yorston
Natanael Copa wrote: >if true; then >cat >>confdefs.h <<_ACEOF >#define `date` >_ACEOF >fi > >Seems like `command` inside heredoc inside if .. fi is needed to trigger it. Using $(command) seems to be a workaround. Ron ___ busybox mailing list

[PATCH] ash: only allow local variables in functions

2015-10-29 Thread Ron Yorston
Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash.c | 3 +++ shell/ash_test/ash-misc/local2.right | 1 + shell/ash_test/ash-misc/local2.tests | 1 + 3 files changed, 5 insertions(+) create mode 100644 shell/ash_test/ash-misc/local2.right create mode 100755

Re: Memory leak in ash with script using "local" incorrectly

2015-10-29 Thread Ron Yorston
Bastian Bittorf wrote: >i just tested v1.24.1 on OpenWrt[1] and there is *no* leak. I think this is due to <0a0acb5> 2015-04-18 [Denys Vlasenko] ash: fix handling of duplicate "local" which is included in 1.24 but not 1.23. This patch detects if a local variable is being declared more than

Re: [PATCH 1.24.1] ash: backport fix for here document issues

2015-10-29 Thread Ron Yorston
Ron Yorston wrote: >Natanael Copa wrote: >>if true; then >>cat >>confdefs.h <<_ACEOF >>#define `date` >>_ACEOF >>fi >> >>Seems like `command` inside heredoc inside if .. fi is needed to trigger it. > >Using $(command) seems to be

Re: [PATCH 5/5] ash: fix error during recursive processing of here document

2015-10-29 Thread Ron Yorston
Denys Vlasenko wrote: >This collides with shell/ash_test/ash-heredoc/heredoc2.right, >for your other patch which I already applied. > >Can you rediff against current git? Sorry... There's a v2 on the list already. Ron ___ busybox mailing list

Another old ash patch

2015-10-29 Thread Ron Yorston
While we're looking at ash patches, this one seems to have slipped through the net as well: http://lists.busybox.net/pipermail/busybox/2015-August/083229.html Ron ___ busybox mailing list busybox@busybox.net

Re: [PATCH 3/3] ash: simplify EOF/newline handling in list parser

2015-10-29 Thread Ron Yorston
Denys Vlasenko wrote: >I applied patch #1, got confused by the discussion of patches 2,3. > >Is there a final version of the fix on the list? The only patches are the ones I submitted. I think they're correct. It is necessary that this patch [PATCH 5/5 v2] ash: fix error during recursive

ash patches

2015-10-29 Thread Ron Yorston
Denys Vlasenko wrote: >I'm done with applying stuff to git tree, it's not in flux now. >Please pull, and let me know what I missed. (ash-heredoc/heredoc2 >still fails). Yes, the heredoc2 test will fail until these are applied:

[PATCH 5/5 v2] ash: fix error during recursive processing of here document

2015-10-29 Thread Ron Yorston
190 203 +13 -- (add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash.c | 5 +++--

Re: busybox 1.24.1 ash regression

2015-10-29 Thread Ron Yorston
Natanael Copa wrote: >I bisected it to: > >7e66102f762a7d80715f0c7e5925433256b78cee is the first bad commit >commit 7e66102f762a7d80715f0c7e5925433256b78cee >Author: Denys Vlasenko >Date: Thu Feb 5 21:00:17 2015 +0100 > >ash: fix a SEGV case in an invalid heredoc

[PATCH] ash: copy function tests from hush testsuite

2015-11-03 Thread Ron Yorston
Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash_test/ash-misc/func1.right | 6 ++ shell/ash_test/ash-misc/func1.tests | 16 shell/ash_test/ash-misc/func2.right | 5 + shell/ash_test/ash-misc/func2.tests | 9 + shell/as

[PATCH] ash: add support for bash 'function' keyword

2015-11-03 Thread Ron Yorston
46) Total: 151 bytes Signed-off-by: Ron Yorston <r...@pobox.com> --- shell/ash.c | 103 +-- shell/ash_test/ash-misc/func_bash1.right | 12 shell/ash_test/ash-misc/func_bash1.tests | 28 + 3 files changed, 112 inserti

  1   2   3   4   5   6   >