unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13553: 24.3.50; incorrect usage of IS_DIRECTORY_SEP
@ 2013-01-26  5:52 Shigeru Fukaya
  2013-01-26 10:26 ` Stefan Monnier
  2013-01-26 12:56 ` Eli Zaretskii
  0 siblings, 2 replies; 15+ messages in thread
From: Shigeru Fukaya @ 2013-01-26  5:52 UTC (permalink / raw)
  To: 13553

Hi,

`file-attributes' returns nil as stat info for a file, its name ending
with a character whose second byte is 0x5c.

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.
I find incorrect usage, at least in some functions of `w32.c'.
(readdir, stat_worker, read_unc_volume)


I show, as a silly sample, of easy fix.

#define IS_AT_DIRECTORY_SEP(p,i) \
  (p[i] == '/' || (p[i] == '\\' && _mbsbtype(p,i) == _MBC_SINGLE))

and,

  IS_DIRECTORY_SEP(p[i]) 

to

  IS_AT_DIRECTORY_SEP(p, i) 


Regards,
Shigeru





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-01-27  9:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-26  5:52 bug#13553: 24.3.50; incorrect usage of IS_DIRECTORY_SEP Shigeru Fukaya
2013-01-26 10:26 ` Stefan Monnier
2013-01-26 11:16   ` Eli Zaretskii
2013-01-26 12:40     ` Stefan Monnier
2013-01-26 13:23       ` Eli Zaretskii
2013-01-26 22:24         ` Stefan Monnier
2013-01-27  7:06           ` Eli Zaretskii
2013-01-27  8:36             ` Shigeru Fukaya
2013-01-27  9:40               ` Eli Zaretskii
2013-01-26 12:56 ` Eli Zaretskii
2013-01-26 14:06   ` Eli Zaretskii
2013-01-26 16:33   ` Shigeru Fukaya
2013-01-26 17:37     ` Eli Zaretskii
2013-01-27  6:56       ` Shigeru Fukaya
2013-01-27  7:15         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).