diff options
author | Christopher Faylor <me@cgf.cx> | 2002-05-24 00:01:46 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-05-24 00:01:46 +0400 |
commit | b4bb31ad55c8e71e7a6e2568f7fba3f395d513ba (patch) | |
tree | bfd877c3a0d390eafe5faf4da866cff27dc4c537 /winsup/cygwin/path.cc | |
parent | f6b2b56722de6c25dff893c19392a1b446c7f4ae (diff) |
* path.cc (path_conv::check): Make sure any trailing path component is part of
potential normalized posix path.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 2f2c19b61..9ae5df8c7 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -408,6 +408,7 @@ path_conv::check (const char *src, unsigned opt, bool need_directory = 0; bool saw_symlinks = 0; int is_relpath; + char *tail; sigframe thisframe (mainthread); #if 0 @@ -463,7 +464,7 @@ path_conv::check (const char *src, unsigned opt, if (error) return; - char *tail = strchr (path_copy, '\0'); // Point to end of copy + tail = strchr (path_copy, '\0'); // Point to end of copy char *path_end = tail; tail[1] = '\0'; @@ -726,8 +727,11 @@ path_conv::check (const char *src, unsigned opt, out: if (opt & PC_POSIX) { + if (tail[1] != '\0') + *tail = '/'; normalized_path = cstrdup (path_copy); debug_printf ("path_copy %s", path_copy); + opt ^= PC_POSIX; } /* Deal with Windows stupidity which considers filename\. to be valid even when "filename" is not a directory. */ |