From: Eli Zaretskii Date: Fri, 25 Jan 2013 14:38:21 +0000 (+0200) Subject: Revert 2013-01-25T10:27:16Z!eliz@gnu.org. X-Git-Tag: emacs-24.3.90~173^2~7^2~218 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cda5fe80631f0697bf63c0cd5fb3fd78fab659df;p=emacs.git Revert 2013-01-25T10:27:16Z!eliz@gnu.org. --- diff --git a/src/ChangeLog b/src/ChangeLog index 66eb75adca7..c6152668a22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,5 @@ 2013-01-25 Eli Zaretskii - * w32.c (readlink): Support DBCS codepages. - * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540) 2013-01-25 Dmitry Antipov diff --git a/src/w32.c b/src/w32.c index dc9233ee001..f722bc5f397 100644 --- a/src/w32.c +++ b/src/w32.c @@ -4639,34 +4639,18 @@ readlink (const char *name, char *buf, size_t buf_size) else { size_t size_to_copy = buf_size; - BYTE *p = lname, *p2; + BYTE *p = lname; BYTE *pend = p + lname_len; - int dbcs_p = max_filename_mbslen () > 1; /* Normalize like dostounix_filename does, but we don't want to assume that lname is null-terminated. */ - if (dbcs_p) - p2 = CharNextExA (file_name_codepage, p, 0); - else - p2 = p + 1; - if (*p && *p2 == ':' && *p >= 'A' && *p <= 'Z') - { - *p += 'a' - 'A'; - p += 2; - } + if (*p && p[1] == ':' && *p >= 'A' && *p <= 'Z') + *p += 'a' - 'A'; while (p <= pend) { if (*p == '\\') *p = '/'; - if (dbcs_p) - { - p = CharNextExA (file_name_codepage, p, 0); - /* CharNextExA doesn't advance at null character. */ - if (!*p) - break; - } - else - ++p; + ++p; } /* Testing for null-terminated LNAME is paranoia: WideCharToMultiByte should always return a