| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Use the new function last_char_is_dir_sep() to save 16 bytes in
bb_get_last_path_component_strip().
|
| |
| |
| |
| |
| |
| |
| | |
Add a convenience function to determine if the last character of
a string is a directory separator.
Adds 16-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
busybox-w32 binaries built using clang crashed so frequently that
they were pretty much unusable. The main issue seems to be with
assignments to the structures containing global variables which
are used in most applets.
Upstream commit 5156b2455 (Make const ptr assign as function call
in clang) addresses this, but is insufficient for the build on
Windows. Extend the idea to the ASSIGN_CONST_PTR() macro too.
Costs 32-80 bytes in the gcc build.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since commit 2af141a2c (ash: changes to login shell functionality)
httpd has failed to run in the background (i.e. without the '-f'
option).
This was due the removal of support for applet names with a '-'
prefix. Although this feature isn't used by the shell it was used
by httpd to mark when the process had been daemonised.
Adds 16 bytes.
(GitHub issue #378)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the ability to override an applet if an external binary was
present was added, the commit message for bd7018350 said:
This doesn't affect tab completion in the shell: whether a
completion is an applet or an external command is irrelevant.
This isn't quite true. Suppose 'applet' has been overridden in
such circumstances:
$ export BB_OVERRIDE_APPLETS=";applet"
$ applet
If the user now enters tab twice the output would be:
applet applet.exe
The applet is still treated as a potential match. Recent changes
to the applet override code result in a simple fix: the shell PATH
can be passed to is_applet_preferred() in the line editing code.
Now only 'applet.exe' is treated as a match.
Adds 16-32 bytes.
|
| |
| |
| |
| |
| | |
This doesn't affect the generated binary, at least in the default
configuration.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Pass the PATH to be used to look up executables down from the shell
to the applet override code. This replaces the use of a static
variable and a function to fetch its value.
Saves 16-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The environment variable BB_OVERRIDE_APPLETS provides control over
which applets are preferred in standalone shell mode. Allow a
similar list to be hardcoded in the binary with the OVERRIDE_APPLETS
configuration string.
The environment variable is checked first. If it doesn't override
the applet the hardcoded string is then checked too.
The default for OVERRIDE_APPLETS is an empty string. In this case
the size and behaviour of the binary is unchanged.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
start_stop_daemon_main 1186 1206 +20
bb_daemonize_or_rexec 196 212 +16
bb_banner 47 46 -1
packed_usage 34656 34645 -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 36/-12) Total: 24 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
sleep_main 116 119 +3
printf_main 860 837 -23
single_argv 50 25 -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 3/-48) Total: -45 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code to replace the user's home directory with '~' in the
prompt didn't allow for the possibility of the HOME environment
variable having backslashes in the path.
Convert backslashes to forward slashes in HOME. This isn't necessary
if the home directory is obtained from getpwuid(3) as it's already
converted there.
Adds 24-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add shell options:
- 'nohiddenglob' excludes files with the hidden attribute from
globbing
- 'nohidsysglob' excludes files with the hidden and system attributes
from globbing
If both options are enabled 'nohiddenglob' takes precedence.
These options also affect tab completion.
Files that are hidden because they start with a period aren't
affected (unless they also have the hidden attribute).
Costs 160-208 bytes.
(GitHub issue #367)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream BusyBox supports the usual Unix functionality where the
login process adds a '-' prefix to the shell's argv[0]. Since
busybox-w32 doesn't have a login process this serves no purpose
and can be removed.
Instead it would be useful to have a way to invoke a login shell
without requiring any arguments. Advantages would be:
- easier to configure busybox-w32 'ash' as the SSH login shell;
- double clicking on a shell binary could start a login shell.
Add 'lash' as an alias for 'ash' which starts a login shell without
requiring the '-l' option.
Saves 16 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 3476fb9f4c (ps: display interpreted script name in comm
column) required the applet start up code to detect the index
of the script in a shebang command line.
When a script starts with '#!/bin/busybox' the argument list is
shifted in busybox_main() but the script index wasn't adjusted
to match. This caused the command to fail.
Make the proper adjustment.
Add 16 bytes.
(GitHub issue #357)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Windows implementation of readlink(2) has caused problems in
the past. As, for example, with commit c29dc205d2 (win32: fix
implementation of readlink(2)).
Most uses of readlink(2) in BusyBox are actually calls to the
(considerably more convenient) library function xmalloc_readlink().
Implement a Windows version of that and used it instead of readlink(2).
This improves the handling of symbolic links (and similar reparse
points) in CJK and UTF-8 code pages.
Saves 48-80 bytes.
|
| |
| |
| |
| |
| | |
When the UTF-8 manifest is included in the binary but the ANSI
code page isn't UTF-8 report "UTF8 manifest not supported".
|
| | |
|
|\| |
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the UTF8 manifest is included in the binary and ACP isn't UTF8
fail at once. This avoids raising false hopes if the binary is run
on Window 7/8. On Windows XP it won't even run.
When the busybox applet is run without arguments always report the
build-time configuration of globbing and the UTF8 manifest.
|
| |
| |
| |
| |
| |
| | |
When the UTF8 manifest is enabled at build time, then the version
now includes a string indicating whether unicode is active (e.g. it's
inactive on win 7/8, but should be active on Win10 1903+).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the Emoticons block U+1F600..U+1F64F as double-width
codepoints, and the skin tone modifiers range U+1F3FB..U+1F3FF
as combining codepoints.
The Emoticons variant modifiers U+FE0E and U+FE0F were already in.
It's unclear how to test UNICODE_COMBINING_WCHARS and
UNICODE_WIDE_WCHARS in general and also here specifically,
but at least the data on Emojis width and combinings now exits.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 8ade494 added VT input support and, among others,
disabled inc_cursor (in favor of the upstream busybox code) when
the terminal has VT input enabled.
However, inc_cursor works correctly regardless of the VT mode,
and that condition was not required.
Revert this condition (but still disable inc_cursor with unicode
because it handles wide-glyphs incorrectly).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
FEATURE_UTF8_MANIFEST enables Unicode args and filenames on Win 10+.
FEATURE_UTF8_INPUT allows the shell prompt to digest correctly
Unicode strings (as UTF8) which are typed or pasted.
This commit adds support for building with FEATURE_UNICODE_SUPPORT
(mostly by supporting 32 bit wchar_t which busybox expects):
- Unicode-aware line-edit - for the most part cursor movement/del
being (UTF8) codepoint-aware rather than assuming that one-byte
equals one-char-on-screen.
- Codepoint-aware operations in some other utils, like rev or wc -c.
- When UNICODE_COMBINING_WCHARS and UNICODE_WIDE_WCHARS are enabled,
some screen-width-aware operations, like with fold, ls, expand, etc.
The busybox Unicode support is incomplete, and even less so with the
builtin libc replacement functions, like wcwidth, which are active
when UNICODE_USING_LOCALE is unset (mingw lacks those functions).
FEATURE_CHECK_UNICODE_IN_ENV should be set so that Unicode is not
hardcoded but rather depends on the ANSI codepage and some env vars:
LC_ALL=C disables Unicode support, else it's enabled if ACP is UTF8.
There's at least one known issue where the tab-completion-prefix-case
is not updated correctly, e.g. ~/desk<tab> completes to ~/desktop/
instead of ~/Desktop/, because the code which handles it exists
only at the non-unicode code paths, but that's not very critical.
That seems to be the only case where mingw-specific code is disabled
when Unicode is enabled, but there could be other unknown issues.
None of the Unicode options is enabled by default, and the next
commit will make it easier to create a build which supports Unicode.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
exit_FAILURE - 7 +7
_exit_FAILURE - 7 +7
run 198 199 +1
restore_state_and_exit 114 115 +1
xbsd_write_bootstrap 399 397 -2
vfork_compressor 209 207 -2
sig_handler 12 10 -2
serial_ctl 154 152 -2
parse_args 1169 1167 -2
onintr 21 19 -2
make_new_session 493 491 -2
login_main 988 986 -2
gotsig 35 33 -2
do_iplink 1315 1313 -2
addgroup_main 397 395 -2
inetd_main 1911 1908 -3
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
bb_perror_nomsg_and_die 9 10 +1
bb_perror_nomsg 9 10 +1
bb_verror_msg 480 469 -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 2/-11) Total: -9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, console input was converted to the ANSI codepage using
OemToChar[Buff], and ANSI to console conversion used CharToOem[Buff].
However, while typically true by default, it's not guaranteed that
the console CP is the same as the OEM CP.
Now the code uses the console input/output CP as appropriate instead
of the OEM CP. It uses full wide-char conversion code, which was
previously limited to FEATURE_EURO, and now may be used also otherwise.
While at it, the code now bypasses the conversion altogether if the
src/dst CPs happen to be identical - which can definitely happen.
Other than saving some CPU cycles, this also happens to fix an issue
with the UTF8 manifest (in both input and output), because apparently
the Oem/Char conversion APIs fail to convert one char at a time (which
is not a complete UTF8 codepoint sequence) even if both the OEM and
the ANSI CPs are UTF8 (as is the case when using UTF8 manifest).
Conversion is also skipped:
- if the converted output would be longer than the input;
- if the input length is 1 and the input is multi-byte.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When an applet is overridden by BB_OVERRIDE_APPLETS it should still
function in certain cases:
busybox applet
applet.exe
busybox --help applet
Arrange for this by adding really_find_applet_by_name() as a static
function in libbb/appletlib.c. find_applet_by_name() is implemented
using this for external use while really_find_applet_by_name() is
used internally in some instances.
Adds 32 bytes.
(GitHub issue #329)
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 105252 105246 -6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With xxd not selected:
function old new delta
display 1459 1444 -15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display 1485 1483 -2
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 104598 104613 +15
display 1475 1485 +10
od_main 549 556 +7
rewrite 971 967 -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 32/-4) Total: 28 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Remove find_preferred_applet_by_name(). Instead add a
reference to is_applet_preferred() in find_applet_by_name().
- Remove the global variable ash_path. Use a static instead,
accessed by calling get_ash_path().
- Mark ash_applet_by_name() as NOINLINE.
Saves 64-96 bytes.
(GitHub issue #329)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Support for conditionally replacing applets with external commands
requires the ability to check whether a given command name is
present on PATH. This was being done using the PATH environment
variable, which works in commands run by the shell but not in the
shell itself.
- The shell uses the *shell* variable PATH to look for executables.
This may not be the same as the *environment* variable.
- 'command -p' uses an entirely different PATH.
Applet look-up in the shell is now treated as a special case, with
the actual PATH being used passed to the look-up code in a global
variable.
This doesn't affect tab completion in the shell: whether a
completion is an applet or an external command is irrelevant.
Costs 152-288 bytes.
(GitHub issue #329)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make the following changes to BB_OVERRIDE_APPLETS:
- Applet names in the list can be separated by spaces, commas or
semicolons.
- Applets before the first semicolon are disabled unconditionally.
- Applets after the first semicolon are overridden if a matching
external command exists.
- '-' alone disables all applets.
- '+' alone overrides every applet for which a matching external
command exists.
This doesn't change the existing documented behaviour. It adds
the ability to have applets overridden if an external command
exists but to remain available if not.
Adds 80-88 bytes.
(GitHub issue #329)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The tab-completion code treated all matches as case-insensitive
because that's how Microsoft Windows handles filenames.
This is now inadequate, as shell builtins, functions and aliases
are case sensitive.
Modify the treatment of case-sensitivity in tab completion:
- Track whether each potential match is case-insensitive (filename)
or case-sensitive (shell builtin, function or alias).
- When comparing matches use a case-insensitive comparison if either
value is a filename. Otherwise use a case-sensitive comparison.
Adds 64 bytes.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When icanon is set with -echo (e.g. ssh from an emacs shell) then
S.state will remain null but later it will be deferenced causing ash to
crash. Fix: additional check on state.
Signed-off-by: Akos Somfai <akos.somfai@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| | |
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
sleep_for_duration 169 149 -20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| | |
For some reason the progress bar in wget has never been enabled.
Costs 1536-1600 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The functions ndelay_on(), ndelay_off() and close_on_exec_on()
don't do anything useful because our fcntl(2) implementation
doesn't support the features they require.
Replace them with stubs.
Saves 176-208 bytes.
|
|\| |
|