trailing spaces in 1.7.0

Corinna Vinschen
Tue May 13 13:50:00 GMT 2008

On May 13 06:17, Eric Blake wrote:
> According to Corinna Vinschen on 5/13/2008 5:53 AM:
>> I can easily fix that, it's a two-liner.  However, that raises the
>> question if it's the right thing to do.  Is it really necessary to
>> convert trailing dots and spaces?  Is it really a problem if Win32
>> applications can't access these files?  I'm a bit unsure if that's
>> not too indulging...
> Once you've gone the route of a trailing dot or slash, your file is already 
> hard to open in Win32 (how do you convince notepad, for example, to open a 
> file with the invalid unicode character 0xf020?).  It's true that once 
> 'tdir ' existed, I couldn't use Explorer to delete it, while I could use 
> Explorer to delete 'tdir\uf020'.  But I don't generally use Explorer to 
> delete files created by cygwin.  So I don't care whether the space and dot 
> are munged, or used unchanged, so long as cygwin can consistently create 
> and access such files and directories, and that they are distinct from 
> their counterpart without trailing dots/spaces.  If not munging the 
> trailing space/slash works, and is slightly faster, then feel free to go 
> for it.

I did so for now but kept the code in, you never know.  Keep in mind
that now the directories which have transposed trailing dots and spaces
in its name will make trouble.  You'll have to remove them using
something like `rmdir tdir~1', as you already noted.

However, I found that I did not get rid of all code which removes
trailing dots and spaces as I thought.  The path_conv::set_normalized_path
method still did it, which resulted in some weird effects like "ls 'tdir '"
works but "cd 'tdir '; ls" returns with an ENOENT error.  This might
explain what you observed in your OP.  If there are more problems, yell.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list