From 8b83da2d55b2a61f22b8b330f966d06e3092b079 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 9 Feb 2016 15:00:30 +0100 Subject: cygwin_conv_path: Always preserve trailing backslashes in conversion to POSIX paths * include/sys/cygwin.h (CCP_CONVFLAGS_MASK): Define. * mount.h (__CCP_APP_SLASH): Define. * mount.cc (mount_info::conv_to_posix_path): Handle __CCP_APP_SLASH flag. * path.cc (cygwin_conv_path): Use CCP_CONVFLAGS_MASK to evaluate "how" flag values. Always add __CCP_APP_SLASH flag when calling mount_info::conv_to_posix_path. Signed-off-by: Corinna Vinschen --- winsup/cygwin/path.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index e49f18043..20391bf98 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3318,7 +3318,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to, char *buf = NULL; PWCHAR path = NULL; int error = 0; - int how = what & ~CCP_CONVTYPE_MASK; + int how = what & CCP_CONVFLAGS_MASK; what &= CCP_CONVTYPE_MASK; int ret = -1; @@ -3444,7 +3444,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to, case CCP_WIN_A_TO_POSIX: buf = tp.c_get (); error = mount_table->conv_to_posix_path ((const char *) from, buf, - how); + how | __CCP_APP_SLASH); if (error) { set_errno (p.error); @@ -3455,7 +3455,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to, case CCP_WIN_W_TO_POSIX: buf = tp.c_get (); error = mount_table->conv_to_posix_path ((const PWCHAR) from, buf, - how); + how | __CCP_APP_SLASH); if (error) { set_errno (error); -- cgit v1.2.3