This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...


On Aug 28 09:16, Houder wrote:
> On Tue, 27 Aug 2019 11:44:17, Vince Rice  wrote:
> 
> > > On Aug 27, 2019, at 11:28 AM, Houder wrote:
> > >
> > > On Tue, 27 Aug 2019 17:25:49, Corinna Vinschen  wrote:
> > >>
> > >> mkdir(2) has some special code from 2009 which drops trailing
> > >> {back}slashes to perform a bordercase in mkdir Linux-compatible.
> > >> This code snippet doesn't exist in rmdir(2).
> > >
> > > .. uhm, I must be speaking to the alter ego of Corinna V,. because
> > > as far as I know, Corinna has given herself some time off ...
> > >
> > > Perhaps you could make an entry in her "TODO list" that the 3 lines
> > > above requires some more explanation for pour souls like me.
> > 
> > I am not Corinna, but I read that as
> > The mkdir command works because it has special code added to it to make
> > it work. The rmdir command doesn't work because it doesn't have the same
> > code in it.
> 
> Right, "Corinna" Number Three.
> 
> Before I sent my question to the list, I had fired up the debugger and
> lured it in providing me the neccessary info:
> 
> It showed me that my input (e:\) was being "mutilated" at the start of
> mkdir() in winsup/cygwin/dir.cc
> 
> Using git I had found the "suspicious-looking" commit by Eric Blake:
> 
>  - https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=52dba6a5c45e8d8ba1e237a15213311dc11d91fb
>    ( Fix some POSIX-compliance bugs in link, rename, mkdir. )
> 
> --
> author	Eric Blake <eblake@redhat.com>	
>         Sat, 26 Sep 2009 15:51:53 +0000 (15:51 +0000) <====
> committer	Eric Blake <eblake@redhat.com>	
>         Sat, 26 Sep 2009 15:51:53 +0000 (15:51 +0000)
> commit	52dba6a5c45e8d8ba1e237a15213311dc11d91fb
> --
> 
> Note September 2009! (as hinted by Corinna's alter ego)

Eric, any insight?  As usual our comments from way back when are lacking
in terms of what exact problem this code is trying to fix/workaround.

Given this case, I wonder if we really need this code or if we can't
just drop it.  Of course, it would be great to learn what bordercase
this code was trying to handle and if there isn't another way to do that.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]