From 86301dfd05730bcd374792cda497812acfe85f46 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sun, 31 Jan 2016 22:22:43 +0000 Subject: [PATCH 2/2] Reattach trailing dirsep on existing directories too (previously this would only happen to non-existing ones). * path.cc (path_conv::check): Reattach trailing dirsep on existing directories too (previously this would only happen to non-existing ones). Signed-off-by: Ray Donnelly --- winsup/cygwin/path.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 5087adf..c8f32da 100755 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1154,7 +1154,8 @@ path_conv::check (const char *src, unsigned opt, } else if (!need_directory || error) /* nothing to do */; - else if (fileattr == INVALID_FILE_ATTRIBUTES) + else if (fileattr == INVALID_FILE_ATTRIBUTES + || ((fileattr & FILE_ATTRIBUTE_DIRECTORY) && !component)) /* Reattach trailing dirsep in native path. */ strcat (modifiable_path (), "\\"); else if (fileattr & FILE_ATTRIBUTE_DIRECTORY) -- 2.5.3