aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-01-25 16:38:21 +0200
committerEli Zaretskii2013-01-25 16:38:21 +0200
commitcda5fe80631f0697bf63c0cd5fb3fd78fab659df (patch)
treec273e5b8cf34d1ab743202bd2c86c96df2e63fcf
parentef3544f6a6cd1cea6a415d58e39d3a4bebd450f5 (diff)
downloademacs-cda5fe80631f0697bf63c0cd5fb3fd78fab659df.tar.gz
emacs-cda5fe80631f0697bf63c0cd5fb3fd78fab659df.zip
Revert 2013-01-25T10:27:16Z!eliz@gnu.org.
-rw-r--r--src/ChangeLog2
-rw-r--r--src/w32.c24
2 files changed, 4 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 66eb75adca7..c6152668a22 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,5 @@
12013-01-25 Eli Zaretskii <eliz@gnu.org> 12013-01-25 Eli Zaretskii <eliz@gnu.org>
2 2
3 * w32.c (readlink): Support DBCS codepages.
4
5 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540) 3 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
6 4
72013-01-25 Dmitry Antipov <dmantipov@yandex.ru> 52013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
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)
4639 else 4639 else
4640 { 4640 {
4641 size_t size_to_copy = buf_size; 4641 size_t size_to_copy = buf_size;
4642 BYTE *p = lname, *p2; 4642 BYTE *p = lname;
4643 BYTE *pend = p + lname_len; 4643 BYTE *pend = p + lname_len;
4644 int dbcs_p = max_filename_mbslen () > 1;
4645 4644
4646 /* Normalize like dostounix_filename does, but we don't 4645 /* Normalize like dostounix_filename does, but we don't
4647 want to assume that lname is null-terminated. */ 4646 want to assume that lname is null-terminated. */
4648 if (dbcs_p) 4647 if (*p && p[1] == ':' && *p >= 'A' && *p <= 'Z')
4649 p2 = CharNextExA (file_name_codepage, p, 0); 4648 *p += 'a' - 'A';
4650 else
4651 p2 = p + 1;
4652 if (*p && *p2 == ':' && *p >= 'A' && *p <= 'Z')
4653 {
4654 *p += 'a' - 'A';
4655 p += 2;
4656 }
4657 while (p <= pend) 4649 while (p <= pend)
4658 { 4650 {
4659 if (*p == '\\') 4651 if (*p == '\\')
4660 *p = '/'; 4652 *p = '/';
4661 if (dbcs_p) 4653 ++p;
4662 {
4663 p = CharNextExA (file_name_codepage, p, 0);
4664 /* CharNextExA doesn't advance at null character. */
4665 if (!*p)
4666 break;
4667 }
4668 else
4669 ++p;
4670 } 4654 }
4671 /* Testing for null-terminated LNAME is paranoia: 4655 /* Testing for null-terminated LNAME is paranoia:
4672 WideCharToMultiByte should always return a 4656 WideCharToMultiByte should always return a