Files
freebsd/bin
Olivier Certner 72bb9eb7b6 pwd(1): De-obfuscate, style(9)
In getcwd_logical(), test for a '.' or '..' component in one of the most
straightforward and intelligible ways possible.

In particular, this removes a superfluous re-test of the the component's
first character being '.' when the first one did not pass and, more
importantly, prevents the second test from relying on a side-effect in
the first.

While here, for better clarity, replace the loop that searches for '/'
with a simple call to strchrnul().

Add high-level comments about what is going on.

While here, test explicitly that pointed 'char' values are not 0 ('\0')
(style(9)).

While here, separate the successive steps of getcwd_logical() with blank
lines.

No functional change (intended).

Discussed with: emaste
Fixes:          2df923c5d2 ("pwd: Clean up and adopt POSIX semantics")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59709
2026-09-23 13:37:45 +02:00
..
2026-08-31 14:35:21 +02:00
2026-07-23 08:21:08 +02:00
2026-02-18 10:50:20 -05:00
…
…
2025-06-20 22:24:10 +00:00
…
…
2026-07-27 20:54:11 +02:00
2026-09-23 13:37:45 +02:00
2026-09-12 10:44:39 -04:00
…