From: Crystal Kolipe Subject: Re: Fix rmdir -p /foo/bar To: Ingo Schwarze Cc: Theo Buehler , Christian Weisgerber , tech@openbsd.org Date: Tue, 13 May 2025 01:50:08 -0300 On Mon, May 12, 2025 at 11:42:43PM +0200, Ingo Schwarze wrote: > Theo Buehler wrote on Mon, May 12, 2025 at 10:03:50PM +0200: > > (If someone copies this chunk of code, they might not notice this > > assumption > > Someone copying this code seems unreasonable to me, given how > specialized it is: "strip any trailing slashes and the last filename > component from the end, then iterate the ends of all other > components" really doesn't sound like something that might be > needed outside "rmdir -p". > Then again, an assertion does prevent overlooking this invariant. > > > and a check in code is always better than a comment.) > > I disagree. Both serve more or less orthogonal purposes. > Checks guard against functional edge cases. Comments help > code review and maintenance. It would also help if we ensure that the CVS commit message makes it clear that the issue was discussed at length on-list. Since our proposed implementation differs from the other BSDs, there is a at least a reasonable chance that anybody interested in the code will look through CVS to see when and why the changes were made.