diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-20 08:27:17 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-20 08:27:17 +0000 |
commit | 18bffeae48f300c813a4999067373498b534c166 (patch) | |
tree | f849c4e30c9959a3f356e33822694a22371cc6cb | |
parent | 8da63be147dd193420f29d864afc5806500f92e7 (diff) | |
download | busybox-w32-18bffeae48f300c813a4999067373498b534c166.tar.gz busybox-w32-18bffeae48f300c813a4999067373498b534c166.tar.bz2 busybox-w32-18bffeae48f300c813a4999067373498b534c166.zip |
win32: change stat(2) error code in certain cases
Commit 325fee1f9 (win32: change handling of trailing slashes in
stat(2)) caused stat(2) to return EINVAL in some cases when ENOENT
might have been more appropriate.
This caused the command:
rm -f dir/*
to report an error when the directory was empty, contrary to its
expected behaviour of saying nothing.
Fixes GitHub issue #155.
-rw-r--r-- | win32/mingw.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 7552d19da..0206f6dca 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -326,7 +326,6 @@ static inline int get_file_attr(const char *fname, WIN32_FILE_ATTRIBUTE_DATA *fd | |||
326 | len = strlen(fname); | 326 | len = strlen(fname); |
327 | if (len > 1 && (fname[len-1] == '/' || fname[len-1] == '\\')) | 327 | if (len > 1 && (fname[len-1] == '/' || fname[len-1] == '\\')) |
328 | return ENOTDIR; | 328 | return ENOTDIR; |
329 | return EINVAL; | ||
330 | default: | 329 | default: |
331 | return ENOENT; | 330 | return ENOENT; |
332 | } | 331 | } |