[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116722: src/w32.c (stat_worker): Fix commentary.
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] trunk r116722: src/w32.c (stat_worker): Fix commentary. |
Date: |
Mon, 10 Mar 2014 17:31:34 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116722
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2014-03-10 19:31:17 +0200
message:
src/w32.c (stat_worker): Fix commentary.
modified:
src/w32.c w32.c-20091113204419-o5vbwnq5f7feedwu-808
=== modified file 'src/w32.c'
--- a/src/w32.c 2014-03-10 17:26:45 +0000
+++ b/src/w32.c 2014-03-10 17:31:17 +0000
@@ -4745,10 +4745,9 @@
return -1;
}
- /* Remove trailing directory separator, unless name is the root
- directory of a drive or UNC volume in which case ensure there
- is a trailing separator. */
len = strlen (name);
+ /* Allocate 1 extra byte so that we could append a slash to a root
+ directory, down below. */
name = strcpy (alloca (len + 2), name);
/* Avoid a somewhat costly call to is_symlink if the filesystem
@@ -4963,6 +4962,7 @@
}
else if (rootdir)
{
+ /* Make sure root directories end in a slash. */
if (!IS_DIRECTORY_SEP (name[len-1]))
strcat (name, "\\");
if (GetDriveType (name) < 2)
@@ -4978,6 +4978,8 @@
{
int have_wfd = -1;
+ /* Make sure non-root directories do NOT end in a slash,
+ otherwise FindFirstFile might fail. */
if (IS_DIRECTORY_SEP (name[len-1]))
name[len - 1] = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116722: src/w32.c (stat_worker): Fix commentary.,
Eli Zaretskii <=