GNU bug report logs -
#13553
24.3.50; incorrect usage of IS_DIRECTORY_SEP
Previous Next
Full log
Message #11 received at 13553 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Sat, 26 Jan 2013 05:26:04 -0500
> Cc: 13553 <at> debbugs.gnu.org
>
> > It is because IS_DIRECTORY_SEP is wrongly used.
> > IS_DIRECTORY_SEP only works when its argument is surely on a start
> > byte of dbcs characters.
>
> If the file name is properly decoded (i.e. in its multibyte form), there
> can't be a 0x5c byte other than at the beginning of a char.
>
> So this bug can only happens if you pass a unibyte filename. IOW the
> bug is probably in the caller rather than in the file-attributes function.
No, it's not in the caller. It's in w32.c, whose functions almost
always manipulate encoded file names (because they shadow system
APIs).
> Please show us the actual situation where this happens, since file names
> are normally always multibyte.
You call file-attributes, which encodes the file name and passes it to
'lstat'. The implementation of 'lstat' in w32.c then looks at the
last byte of the encoded file name to see if there's a slash or
backslash there. Boom!
I will fix that.
This bug report was last modified 12 years and 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.