| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 31467ddfc (win32: changes to stat(2) implementation) followed
symlinks manually. Unfortunately the implementation was incorrect.
Use xmalloc_follow_symlinks() instead.
Saves 32-48 bytes.
|
| |
| |
| |
| |
| |
| | |
Fix a bug in process_command() where an escaped newline followed
by a character other than tab resulted in premature termination
of the command.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is an experimental implementation of make for busybox-w32,
based on my public domain POSIX make:
https://frippery.org/make/
(GitHub issue #44)
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the 'cc' command is invoked with autoindent enabled it
should use the indent of the first line being changed.
The size of the indent has to be established before char_insert()
is called as the lines being changed are deleted. Introduce a
new global variable, newindent, to handle this. The indentcol
global is now effectively a static variable in char_insert().
function old new delta
do_cmd 4247 4308 +61
vi_main 416 422 +6
char_insert 891 875 -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 67/-16) Total: 51 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Suppose autoindent is enabled and we have a line with an initial
tab where we want to split the words onto separate lines:
split the words
One way to do this is with the sequence 'f r<CR>;r<CR>', but in
BusyBox vi the result is:
split
he
words
This is a regression introduced by commit 9659a8db1 (vi: remove
autoindent from otherwise empty lines). The amount of indentation
is being recorded when the 'r' command inserts a newline but
isn't subsequently reset. A fix is to only record the indent
when in insert or replace mode. Proper handling of the 'o' and
'O' commands then requires them to switch to insert mode before
calling char_insert() to insert a newline.
function old new delta
char_insert 884 891 +7
do_cmd 4243 4247 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 11/0) Total: 11 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ash and hush correctly use the value of HOME for tilde expansion.
However the line editing code in libbb obtains the user's home
directory by calling getpwuid(). Thus tildes in tab completion
and prompts may be interpreted differently than in tilde expansion.
When the line editing code is invoked from a shell make it use the
shell's interpretation of tilde. This is similar to how GNU readline
and bash collaborate.
function old new delta
get_homedir_or_NULL 29 72 +43
optschanged 119 126 +7
hush_main 1204 1211 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 57/0) Total: 57 bytes
v2: Always check for HOME before trying the password database: this
is what GNU readline does.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The functions bb_perror_nomsg() and bb_perror_nomsg_and_die() are
used to print error messages where no specific information is
available. For example:
$ busybox mktemp -p /
mktemp: (null): Permission denied
mktemp(3) doesn't tell us the name of the file it tried to create.
However, printing '(null)' is a regression introduced by commit
6937487be (libbb: reduce the overhead of single parameter bb_error_msg()
calls). Restore the previous behaviour by reverting the changes to
the two functions mentioned:
$ busybox mktemp -p /
mktemp: Permission denied
function old new delta
bb_perror_nomsg_and_die 7 14 +7
bb_perror_nomsg 7 14 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 14/0) Total: 14 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display_topmem_process_list 530 564 +34
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Scoop uses PowerShell's New-Item to create junctions. However,
these junctions lack a PrintName. This is a known issue which
has caused problems even for Windows' File Explorer:
https://github.com/PowerShell/PowerShell/issues/12923
Revert commit 32de287bb (win32: code shrink readlink(2)) to that
readlink(2) uses SubstituteName instead.
(GitHub issue #261)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A user reports:
Here is the shell script that causes me problems:
var=foo:bar
echo ${var#*[[:space:]]}
What expect I to see echoed is foo:bar, however what I see
bar. It seems that the [[:space:]] character class is matching
the colon character in addition to whitespace characters. I
see the same problem with the [[:blank:]] character class.
This is due to a bug in the WIN32 implementation of fnmatch(3)
which is derived from an old snapshot of glibc code (glibc commit
7814856974 from 1999-09-12). The bug was fixed in glibc by commit
83b1b6d8fa of 2000-07-04.
Apply the equivalent fix to our version.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Use repeated calls to readlink(2) rather than xmalloc_realpath()
when asked to follow symlinks.
- Drop the non-standard feature that caused readlink(2) to return
only the target string length.
This improves compatibility with BusyBox on Linux at a cost of
16-32 bytes.
|
| |
| |
| |
| | |
Reduce duplicated code. Saves 16-48 bytes.
|
| |
| |
| |
| |
| |
| | |
Previously stat(2) set st_size to the length of the canonicalised
symlink target. Call readlink(2) to get the actual length of the
target string.
|
| |
| |
| |
| |
| |
| |
| | |
Use PrintName rather than SubstituteName from the reparse data
buffer. This avoids the need to normalise the name.
Saves 240 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a function to check if a file is a directory and use it in
various places.
Replace some uses of S_ISDIR() with a test of the Windows file
attributes.
Saves 32-48 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 6f8b2f450 (ash: forkshell code shrink) noted that certain
global variables were being passed around in the forkshell structure
unnecessarily.
In fact, since the variables are global there's no need to pass
them to the *_size()/*_copy() functions at all. This only saves
32 bytes of bloat (the compiler got there ahead of us) but it does
make the code tidier.
|
| |
| |
| |
| |
| |
| | |
List all attributes in the help from lsattr.
Minor changes to attribute names in output.
|
| |
| |
| |
| |
| | |
Use the new st_tag member of struct stat to display whether a
reparse point is a junction or a symlink.
|
| |
| |
| |
| |
| |
| |
| |
| | |
If a file is a junction or symlink return its tag in the st_tag
member of struct stat.
get_symlink_data() and is_symlink() also return the tag or zero,
as appropriate.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Drop fgetsetflags() and move its functionality into chattr and
lsattr. Raw file attributes are available from struct stat.
In chattr don't compile code related to the unused (on Windows)
OPT_SET option.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 3194a475d (ash: export certain variables to the environment
immediately) caused the special variables BB_OVERRIDE_APPLETS,
BB_SKIP_ANSI_EMULATION and BB_SYSTEMROOT to be exported to the
environment.
If one of these variables is replaced by a local variable its
previous value should be re-exported on leaving the local context
(function or simple command).
(GitHub issue #256)
|
| |
| |
| |
| |
| |
| |
| | |
Junctions created by 'jn' contained incorrect data: the length
of the target name was off-by-one.
(GitHub issue #251)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a Windows-specific applet to create a directory junction.
Usage: jn DIR JUNC
where DIR must be an existing directory on a local drive and JUNC
must not currently exist.
There isn't a simple WIN32 API to create directory junctions.
The implementation of mklink in ReactOS provided useful inspiration.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Unix the link count of a directory reflects the number of
subdirectories it contains. Enhance readdir(3) to return file
types and use this to count subdirectories when stat(2) is called
for a directory.
As with other features that might slow down stat(2) this is
controlled by the build-time setting FEATURE_EXTRA_FILE_DATA.
(Commit d82db8e9a 'win32: make stat(2) fetch additional metadata').
(GitHub issue #254)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Directory junctions were always followed to their target so they
appeared to *be* directories. This resulted in counter-intuitive
behaviour:
- a directory junction could be removed with rmdir even though
the directory wasn't empty;
- 'rm -rf' on a directory junction deleted it but also deleted
the contents of the linked directory.
A better approximation is to treat directory junctions as
symbolic links.
(GitHub issue #254)
|
| | |
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display_process_list 1186 1168 -18
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display_process_list 1191 1186 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display_process_list 1077 1191 +114
.rodata 104803 104807 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 118/0) Total: 118 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
seedrng_main 906 880 -26
.rodata 104899 104873 -26
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-52) Total: -52 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Or else security people will never stop nagging us.
function old new delta
seedrng_main 884 906 +22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 104906 104899 -7
init_main 786 776 -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-17) Total: -17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
tsort_main - 578 +578
.rodata 104884 104906 +22
applet_names 2759 2765 +6
applet_main 1596 1600 +4
packed_usage 34290 34288 -2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 610/-2) Total: 608 bytes
Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's very inconvenient for a cron user not to be able to set a
"personal" PATH for their cron jobs, as is possible with other crons
function old new delta
load_crontab 868 942 +74
.rodata 104878 104884 +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 80/0) Total: 80 bytes
Signed-off-by: Paul Fox <pgf@foxharp.boston.ma.us>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can now remove a separate buffer
function old new delta
seedrng_main 930 884 -46
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
packed_usage 34295 34290 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
As proposed by Jason.
getrandom() is more likely to block on reads larger than this.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
seedrng_main 982 930 -52
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
seedrng_main 994 982 -12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also, do not test for locking errors: on Linux, they do not happen.
function old new delta
.rodata 104900 104878 -22
seedrng_main 1022 994 -28
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
seedrng_main 1003 1022 +19
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 104898 104900 +2
seedrng_main 1011 1003 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-8) Total: -6 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 104929 104898 -31
seedrng_main 1050 1011 -39
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Struct initializers do this double init:
># util-linux/seedrng.c:88: struct pollfd random_fd = {
movl $0, 132(%esp) #, random_fd
movl $0, 136(%esp) #, random_fd
...
># util-linux/seedrng.c:88: struct pollfd random_fd = {
movl %eax, 140(%esp) # _110, random_fd.fd
movw $1, 144(%esp) #, random_fd.events
and close(random_fd.fd) needs to pull the item from the stack:
pushl 132(%esp) # random_fd.fd
call close #
function old new delta
seedrng_main 1076 1050 -26
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|