aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/w32.c b/src/w32.c
index 11fb2a72f69..e84c63d674c 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5138,7 +5138,10 @@ fstatat (int fd, char const *name, struct stat *st, int flags)
5138 5138
5139 if (fd != AT_FDCWD) 5139 if (fd != AT_FDCWD)
5140 { 5140 {
5141 if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name) 5141 char lastc = dir_pathname[strlen (dir_pathname) - 1];
5142
5143 if (_snprintf (fullname, sizeof fullname, "%s%s%s",
5144 dir_pathname, IS_DIRECTORY_SEP (lastc) ? "" : "/", name)
5142 < 0) 5145 < 0)
5143 { 5146 {
5144 errno = ENAMETOOLONG; 5147 errno = ENAMETOOLONG;