Re: [PATCH] Fix concat_path() functions to work for edge-cases too.

"Kevin J. McCarthy" <[email protected]> Sat, 9 May 2026 10:30:44 +0800
Newsgroups gmane.mail.mutt.devel
Message-ID <af6cVE_vFNcH7tma@qinghai>
On Fri, May 08, 2026 at 08:59:35PM +0800, Kevin J. McCarthy wrote:
>This fixes the edge cases tested by Derek Martin.
>  "foo/bar/" + "/baz"  gave: "foo/bar//baz" should be: "foo/bar/baz"
>  ""         + "/baz"  gave: "//baz"        should be "/bar"
>  "/"        + "/foo"  gave  "//foo"        should be "/foo"
>
>All three bugs were triggered by a leading "/" in fname.
>
>The one line strspn() fix is by Alejandro Colomar, but has also been
>applied to the lib.c version.
>
>Many thanks to Derek Martin, for noticing the edge case failures,
>creating a suite of tests, and also working on proposed patches to fix
>the problem.  Also thanks to Rene Kita for his feedback and proposed
>version.
>
>In the end, this was the simplest version that was easy to apply to
>both concat_path() functions.

I've pushed this to stable and merged it into master.

I realized just after I pushed that I forgot to add your Reviewed-By 
signature to the commit message, Alex.  Sorry about that, but thank you 
for the review in any case!

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmn+nFQACgkQre92hIAx
a9oMJA//UsIxEcqVrHESDwB3ZOOEa3NAKzTg6cyGUF/RDWlD9XLJ3RItajbWL8pn
gMmogf6VYou/wqwiSSoW5rJuCe4V/5swZZFGD1e/15DMswSef2quYNcfc9RcNK0p
RvJ3g1wngDdXE4f5Rt77p+8ECiE5rAtLyn6Fz/n9M5id4QOOakAZzVq4RYYWT1js
hir+ND8T21jDTWgRDkq6DbovpFUG1NhRZvJ8EcPwYcn2taONXZJUkgW/pUZ6Zpnu
tjd+wZxxwwOaHpWI5WCJnvxX+7lTJzN62fAW6UFJ0iG1HcImyj9Z+mTxzac3vFtI
oAirWtf33pyRjWcSwYfnW9BniE4p+1HB+Lpz7+i+UpySRUJN7F70Dnv7v4GIOo9N
3yaWG+Rf0mSzR/S0+iIfUFIPbhJ+N4FpMJA5aSvITWWrvF9nJiQjPaXXVXTUn4fB
B31SsovADE0vrz89Zr72nXO0NW5RaPZ0Ifw1QM0ZOlu9HmDwoZ+30PIF0GVnTZvj
vSKRcP8UaiyipFbwSWKMbzx7FDmtKH5/X9JiWM4u1IwoR02e3+Kfbg+taA/Gf8OY
1fNWylXX5GZk9nOAz+axbNBzC4AyGEqIMtJk0Qf7P5Rf7v4fciCTj/b17Gj3bx/j
gLYFFh0WhjAoUPYI3FfMMumcIuGh4n0y5QJMTWGLRVfL8lAe6oU=
=CDkI
-----END PGP SIGNATURE-----