From 18bffeae48f300c813a4999067373498b534c166 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 20 Mar 2019 08:27:17 +0000 Subject: 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. --- win32/mingw.c | 1 - 1 file changed, 1 deletion(-) (limited to 'win32') 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 len = strlen(fname); if (len > 1 && (fname[len-1] == '/' || fname[len-1] == '\\')) return ENOTDIR; - return EINVAL; default: return ENOENT; } -- cgit v1.2.3-55-g6feb