Re: [PATCH] Expand the rename(2) workaround in mingw to cover case change in filename
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 8, 2009, 21:59 UTC
- Message-ID
- <alpine.DEB.1.00.0906082355350.26154@pacific.mpi-cbg.de>
- In-Reply-To
- <20090608203248.GA22972@blimp.localdomain>
Hi,
On Mon, 8 Jun 2009, Alex Riesen wrote:
Show 8 quoted lines
> Windows, being a case-confused operating system, sometimes has > problems renaming directory entries with only change in the case > of their characters. Try to work the problem around by using an > intermediate file. > > --- > > NOT TESTED. Can't. My Windows broke again. Not even compile-tested.
Yes, that is pretty easy to see as you first used pold/pnew and then src/dst.
I minimally fixed up your patch (it now uses strbuf), and added a test-case.
This test-case is actually crucial: it shows that your patch is not enough: the culprit is this code in builtin-mv.c:167--168:
else if (lstat(dst, &st) == 0) {
bad = "destination exists";Ciao, Dscho