| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Have bs_to_slash() return a pointer to its argument. This allows
some calls to be chained, saving 32 bytes.
|
| |
| |
| |
| |
| |
| |
| | |
Since we don't have a working clock_settime(2) there's no point
in claiming to support the '-s' option.
Saves 96 bytes
|
| |
| |
| |
| |
| |
| |
| | |
Since we don't support execution of signal traps or the 'trap hack'
there's no need for the may_have_traps variable or trap_ptr.
Saves 64 bytes.
|
| |
| |
| |
| |
| |
| |
| | |
If a trap is set for SIGINT don't call raise(SIGINT) in preadfd(),
otherwise the shell exits because the signal isn't being caught.
In forkshell_init() change the initialisation of trap and trap_ptr.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since signal handling isn't functional for WIN32 there's no need
to compile dotrap(). Some elements of the globals_misc structure
can also be excluded.
Saves 144 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Consider this script:
while read -r; do echo $REPLY; done
echo hello
There are currently two problems with this when the read is interrupted
by ctrl-C:
- The error return code is 0 when it should be 130;
- The echo command is executed.
Fix these issues by propagating the control event to the process that
would have caught it if the read builtin hadn't grabbed keyboard input.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The read builtin didn't detect EOF so it wasn't possible to cleanly
terminate a loop like:
while read -r; do echo $REPLY; done
Consider how Linux handles EOF (represented as ^D, though this isn't
echoed):
$ awk '{print}' | xxd
abc^D123
^D
00000000: 6162 6331 3233 0a abc123.
Contrast with busybox-w32 on Windows (where the ^Z is echoed):
$ awk '{print}' | xxd
abc^Z123
^Z
00000000: 6162 631a 3132 330a abc.123.
In both cases EOF is only detected at the start of a line. On Linux
EOF within a line is dropped; on Windows it's output as a literal ctrl-Z.
Implement similar behaviour for the read builtin.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously the 'read' builtin had no special treatment for backspace
characters entered in interactive mode: they were simply added to
the string being read.
Change this so that backspace deletes the previous character from
the buffer and updates the display to match. It still doesn't
handle tabs in the input or lines that are larger than the console
width.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closing 'vi' in Windows 7 resulted in the console window failing to
echo any output correctly until the 'reset' builtin was run. This
didn't happen in Windows XP, 8 or 10.
The problem is fixed by only duplicating the console handle when switching
*to* the alternate screen buffer.
Add sanity checks so that switching to the alternate buffer requires
the cached handled to be invalid, while it must be valid when switching
from the alternate buffer.
|
| | |
|
| |
| |
| |
| | |
No change in functionality or executable size.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a format specification is replaced the loop variable 't'
should point to the last character of the replacement string in
the new format buffer.
In an extreme case if the original format string is "%z" and
tm->tm_isdst is negative to indicate that no DST information is
available the replacement string will be empty and 't' will point
to the location before the start of the new format buffer. This
is OK.
|
| |
| |
| |
| |
| | |
The security descriptor was being freed before its contents were
accessed.
|
| |
| |
| |
| |
| |
| | |
Commit 2ffcb860e (ash: minor fixes to forkshell handling) ensured
that tblentry structures were properly aligned but also resulted
in reads beyond the end of the allocated structure.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The functions to calculate the size of the forkshell data block
returned the total size of funcblock and funcstring. The relocation
map only needs to cover the size of the forkshell structure plus
funcblock, not funcstring.
Revise the *_size() functions to distinguish between funcblock and
funcstring. Avoid complicating the calculation of node sizes
(calcsize() and related functions). This slightly overestimates the
size of funcblock by including strings stored in node structures.
This change increases the binary by 96 bytes but can save several
thousand bytes at runtime.
|
| |
| |
| |
| |
| |
| |
| | |
The MARK_PTR macro was unnecessarily complex. Since the relocation
map is a fixed offset from the start of the forkshell structure we
can obtain a pointer to the flag corresponding to a given destination
pointer knowing just the pointer and the offset. Saves 324 bytes.
|
| |
| |
| |
| |
| |
| | |
Group together the code to mark pointers in the relocation map and
that to store annotations. This allows some optimisations when
forkshell debugging is enabled, saving 32 bytes.
|
| |
| |
| |
| |
| |
| |
| | |
Currently the size of the relocate map is equal to the size of the
forkshell struct plus funcblock and funcstring. This may not always
be the case so record the size of the map separately. This doesn't
affect the size of the binary.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original code kept an array of pointers to pointers that needed
to be adjusted after forkshell (nodeptr). Switch to using a map to
indicate which locations in the data block need to be adjusted.
This requires a larger data block. However the *_size() functions
which calculate the data block size need less information about the
data structures. Saves about 100 bytes in the binary.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Ensure that tblentry structures are properly aligned. The cmdname
array has a size of one but the code doesn't allow for this in case
upstream ever switches to using an empty array.
Remove a couple of unnecessary increments.
|
| |
| |
| |
| |
| |
| | |
- Update configuration files
- Omit unnecessary libraries
- Replace fake stime(2) with fake clock_settime(2)
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
query 517 554 +37
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this change, a request to reboot could be "overwritten" by e.g.
SIGHUP.
function old new delta
init_main 709 793 +84
packed_usage 33273 33337 +64
run_actions 109 117 +8
stop_handler 87 88 +1
check_delayed_sigs 340 335 -5
run 214 198 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/2 up/down: 157/-21) Total: 136 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
set_sane_term 111 114 +3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds -R option to grep similar to GNU grep. It is the same as -r
but also dereferences symbolic links to directories.
function old new delta
grep_main 834 850 +16
packed_usage 33362 33368 +6
grep_file 1440 1441 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 23/0) Total: 23 bytes
Signed-off-by: Tomi Leppanen <tomi.leppanen@jolla.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
bc_num_cmp 249 259 +10
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
stime() has been deprecated in glibc 2.31 and replaced with
clock_settime(). Let's replace the stime() function calls with
clock_settime() in preperation.
function old new delta
rdate_main 197 224 +27
clock_settime - 27 +27
date_main 926 941 +15
stime 37 - -37
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When IF_DESKTOP is not defined, chown and chgrp only takes option -R -h,
However the usage output of chgrp is wrong:
$ ./busybox.nosuid chown
Usage: chown [-Rh]... USER[:[GRP]] FILE...
$ ./busybox.nosuid chgrp
Usage: chgrp [-RhLHP]... GROUP FILE...
$ ./busybox.nosuid chgrp -H group dummy
chgrp: invalid option -- 'H'
Usage: chgrp [-RhLHP]... GROUP FILE...
The chgrp is now a wrapper of chown, so the recognized options shall be the same.
This is introduced by 34425389e09353a8dacdd6b23a62553f699c544c
I would expect the correct behavior shall be the same as chown.
So suggest the below patch, the behavior shall be:
$ ./busybox.nosuid chgrp
Usage: chgrp [-Rh]... GROUP FILE...
Signed-off-by: Shuang Liu <sliu@de.adit-jv.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
taskset_main 986 987 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
taskset_main 925 986 +61
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
packed_usage 33236 33247 +11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
taskset_main 511 855 +344
Based on patch by Fryderyk Wrobel <frd1996@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
restore_redirects 52 95 +43
save_fd_on_redirect 243 253 +10
hfopen 90 99 +9
fgetc_interactive 259 261 +2
builtin_type 117 115 -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 64/-2) Total: 62 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
> 2018-07-25:
> ntpd: increase MIN_FREQHOLD by 3
> This means we'll start correcting frequency ~5 minutes after start,
> not ~3.5 ones.
> With previous settings I still often see largish ~0.7s initial offsets
> only about 1/2 corrected before frequency correction kicks in,
> resulting in ~200ppm "correction" which is then slowly undone.
Review of real-world results of the above shows that with small
initial offsets, freq correction can be allowed to kick in sooner,
whereas with large (~0.8s) offsets, we still start freq correction
a bit too soon.
Let's rebalance this a bit.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for querying and parsing SRV DNS records.
function old new delta
send_queries 1711 1865 +154
qtypes 72 80 +8
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Under some circumstances, a DNS reply might contain no resource records,
e.g. when a valid domain is queried that does not have records of the
requested type.
Example with nslookup from BIND dnsutils:
$ nslookup -q=SRV example.org
Server: 10.11.12.13
Address: 10.11.12.13#53
Non-authoritative answer:
*** Can't find example.org: No answer
Currently the busybox nslookup applet simply prints nothing after the
"Non-authoritative answer:" line in the same situation.
This change modifies nslookup to either print "Parse error" or "No answer"
diagnostics, depending on the parse_reply() return value.
function old new delta
send_queries 1676 1711 +35
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
huft_build 1008 1022 +14
inflate_block 1253 1256 +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 17/0) Total: 17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|