busybox/include
Ron Yorston 94eb1c4dc6 libbb: better coreutils compatibility for realpath
Add some tests which coreutils realpath pass but BusyBox realpath
fails (bar one).  Adjust xmalloc_realpath_coreutils() so the tests
pass:

- Expand symbolic links before testing whether the last path component
  exists.

- When the link target is a relative path canonicalize it by passing
  it through xmalloc_realpath_coreutils() as already happens for
  absolute paths.

- Ignore trailing slashes when finding the last path component and
  correctly handle the case where the only slash is at the start of
  the path.  This requires ignoring superfluous leading slashes.

- Undo all changes to the path so error messages from the caller show
  the original filename.

function                                             old     new   delta
xmalloc_realpath_coreutils                           214     313     +99

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-09 01:47:12 +02:00
..
.gitignore ash: allow shell scripts to be embedded in the binary 2018-11-01 10:15:13 +01:00
applet_metadata.h
applets.h.sh modprobe-small: make applets individually selectable 2016-12-23 15:13:16 +01:00
applets.src.h Tweaks to build process for embedded scripts 2018-11-27 10:38:10 +01:00
ar_.h archival: avoid std namespace for local includes 2020-11-16 13:24:24 +01:00
bb_archive.h tar,smemcap: commonalyze checksumming code for tar header 2021-08-20 17:58:49 +02:00
bb_e2fs_defs.h lsattr: support more ext2 flags 2021-06-20 12:34:05 +02:00
busybox.h config: disentangle PREFER_APPLETS from SH_STANDALONE and SH_NOFORK 2016-07-22 18:48:38 +02:00
dump.h xxd: implement -i "C style output" 2021-06-18 00:59:17 +02:00
fix_u32.h
grp_.h
inet_common.h
libbb.h libbb: better coreutils compatibility for realpath 2021-10-09 01:47:12 +02:00
liblzo_interface.h lzop: code shrink 2018-02-01 01:41:31 +01:00
platform.h ash: add process substitution in bash-compatibility mode 2021-06-05 23:37:19 +02:00
pwd_.h
rtc_.h move ADJTIME_PATH define to header files 2020-12-17 20:53:43 +01:00
shadow_.h
unicode.h
usage.src.h httpd,telnetd: make default port configurable 2021-09-09 21:42:48 +02:00
volume_id.h
xatonum.h
xregex.h