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

Alejandro Colomar via Mutt-dev <[email protected]> Sat, 9 May 2026 06:47:27 +0200
Newsgroups gmane.mail.mutt.devel
Message-ID <af679rcTimU4XJMY@devuan>
Hi Kevin,

On 2026-05-09T10:30:44+0800, Kevin J. McCarthy wrote:
> 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!

Don't worry.  Actually, I was thinking you were not adding it anywhere
(I didn't check any of them).  Thanks for having been adding them
regularly!  :-)

I also accidentally omit them from time to time.  ;)


Have a lovely day!
Alex

> 
> -- 
> Kevin J. McCarthy
> GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA



-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmn+vF4ACgkQ64mZXMKQ
wqlxAQ/8Cszvs09BSbnWY909pj4glM+R2Zlu6ReoahOPFgfcfJ4AGWMOee0F1tLn
f527ndBMc85bknjuTI79hgaUz6POgJtO0zKetMI62X77mXeCLYEuHAIe66njgE2Q
amcPZuHDKofLl3IR67yQNrftbZG5WEvHKzK6PgnZtvYEUWRfWrq8HQysNoxfgpMF
FDCDCkt39917GKvdpo0s7C6AyS1D8vi0X2LnQ0ZCVWM6ymopJX67KVDWfQVqtblg
b+JgItGzX21fyCIhZsQlkNH7dee+M0Rq9Z250UNW/zLN2cIBK9UOp+JbYRledrtY
kHJskQodbHBblK0nmilW8BaIxTxWullwpS13gTC0Ma177MbDdLQ2rAAH6Kkd4pjl
/tN/xb4mKZFzsd3cX0gkAGSshoA+wv5bxpjij9PCOJRlFVR/2CO8fulwBjbx4yjH
tbXxQkSNWXrsEpxsGO3raaaJYWO+x8HDm8/ZpE0D5RqeDfBkP8a2ON7r1aXvQuMI
T1uZHGpYQzdJGJCw3hV3poOhuLUhGG/o+Mi5xy8R4PVLcxXDYgvgooO0/1anXk6I
/R/f1F+mvbP+mpA7Kc1f5y6hF8CPEwDCWZZVLwXACsxhz7ZwoN9AiCRtzFJlKRvI
mThIif/3iFH+vWJBKiXd3reVB+FuvHz8xDAKOwrlh4KmcgdiSPc=
=e13K
-----END PGP SIGNATURE-----