diff options
| author | Eli Zaretskii | 2014-03-10 19:26:45 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2014-03-10 19:26:45 +0200 |
| commit | 70db0db7bf9fe648584f4e00a71c8c3b272a5d03 (patch) | |
| tree | bbd76f9c98d7816bea75d90cf64f6de680699582 /src/w32.c | |
| parent | 4f9700e529afe527d50ef519e9e26677765a12f8 (diff) | |
| download | emacs-70db0db7bf9fe648584f4e00a71c8c3b272a5d03.tar.gz emacs-70db0db7bf9fe648584f4e00a71c8c3b272a5d03.zip | |
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>.
Diffstat (limited to 'src/w32.c')
| -rw-r--r-- | src/w32.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -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; |