History log of /src/usr.bin/realpath/realpath.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
# 1.3 25-May-2023 kre

If it isn't possible to determine the realpath() of ".", then simply
give up on attempting to resolve any relative path - there's no hope.


Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.2 21-Jul-2022 kre

Make realpath(1) compat with the planned (not yet approved) specification
for POSIX.8 (its next version). (Should the requirements change, the code
here can be updated).

This adds two new options. -e and -E
-e just tells realpath to do what it has done since it was imported here.
-E makes realpath more compatible with the coreutils version, and allows
the final component of the path to not exist (the final component after
all symlinks have been expanded, not of the arg on the command line - though
that one not existing is one case of the more general spec.).

POSIX is not going to specify which of those is the default - instead is
planning to require users to always explicitly specify one.

The default (now) here is -E. This makes us more compat with coreutils.
realpath was added in the first place because it is (apparently) used in
real world scripts - the more we can support, the better.

Note that in all cases where realpath -e succeeds, realpath -E will succeed
as well. This means that any uses of "realpath file" that have been
working in HEAD will still work. Some cases that would have failed
will work (by default) now.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.1 02-Feb-2020 kamil

branches: 1.1.4;
Port realpath(1) from FreeBSD

realpath(1) wraps realpath(3) and returns resolved physical path.

This utility shipped with GNU and FreeBSD is sometimes
used in scripts in the wild.