Commit 70db0db7 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix an obscure bug in fstatat on Windows 9X.

 src/w32.c (fstatat): Don't add an extra slash if the argument ends
 with a slash: this fails the subsequent call to stat_worker on
 Windows 9X.  Reported by oslsachem <oslsachem@gmail.com>.
parent 4f9700e5
2014-03-10 Eli Zaretskii <eliz@gnu.org>
* w32.c (fstatat): Don't add an extra slash if the argument ends
with a slash: this fails the subsequent call to stat_worker on
Windows 9X. Reported by oslsachem <oslsachem@gmail.com>.
2014-03-10 Martin Rudalics <rudalics@gmx.at>
* w32term.c (w32_read_socket): In SIZE_RESTORED case
......
......@@ -5138,7 +5138,10 @@ fstatat (int fd, char const *name, struct stat *st, int flags)
if (fd != AT_FDCWD)
{
if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name)
char lastc = dir_pathname[strlen (dir_pathname) - 1];
if (_snprintf (fullname, sizeof fullname, "%s%s%s",
dir_pathname, IS_DIRECTORY_SEP (lastc) ? "" : "/", name)
< 0)
{
errno = ENAMETOOLONG;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment