[bug #66568] document whether find's -execdir option is guaranteed to produce pathnames that start with ./

Bernhard Voelker <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Update of bug #66568 (group findutils):

                  Status:               Confirmed => Fixed
           Fixed Release:                    None => 4.11.0

    _______________________________________________________

Follow-up Comment #3:

Thanks - pushed with some minor tweaks, e.g. the commit message shall state
which files have been touched.
I also pushed two other minor changes:

* [PATCH 3/3] doc: state that -execdir prepends the base names with "./"
  https://git.sv.gnu.org/cgit/findutils.git/commit/?id=a78812c62e7

* [PATCH 2/3] doc: maint: break lines at sentences in a paragraph to change
  https://git.sv.gnu.org/cgit/findutils.git/commit/?id=1da19bdba76

* [PATCH 1/3] maint: fix typo in comment
  https://git.sv.gnu.org/cgit/findutils.git/commit/?id=00e82f2c15f

> Just out of curiosity, why does it handle `/` specially?

Good question.

Searching in the git history, this was added (and later only modified) in
commit [1]
back in 2005.  The intention was to use suffix "./" unless for absolute file
names.

[1] https://git.sv.gnu.org/cgit/findutils.git/commit/?id=74a750b11fba

Then in 2010, there was then the change in commit [2] as a fix for  for bug
#27563
(-L breaking -execdir).  That changed slightly the logic, as it first applies
base_name(), and then checks whether the result is starting with "/" or not.
Obviously, that is then only true for the root directory "/".

[2] https://git.sv.gnu.org/cgit/findutils.git/commit/?id=e1d0a991e96e

Maybe James would remember why exempting the root directory from
prefixing with "./" would be useful.  Looking at this test file,
there was a bug report for exactly "/" as starting point:

https://git.sv.gnu.org/cgit/findutils.git/tree/find/testsuite/find.gnu/execdir-root-only.exp?h=v4.10.0


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66568>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZ2rCDgAKCRCqLAuaBUf3
TqLsAQDAxspdJJQBs4hyzAFVWSea/NlYZ6qn4o5u3TUwCDOCSAD+MwycG2mnn35Q
ymlR89ixSvfgnpWy++pdo+8PlTrxrwQ=
=fAVK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.