Cygwin: mkdir and rmdir: treat drive names specially

If the directory name has the form 'x:' followed by one or more
slashes or backslashes, and if there's at least one backslash, assume
that the user is referring to 'x:\', the root directory of drive x,
and don't strip the backslash.

Previously all trailing slashes and backslashes were stripped, and the
name was treated as a relative file name containing a literal colon.

Addresses https://cygwin.com/ml/cygwin/2019-08/msg00334.html.
This commit is contained in:
Ken Brown
2019-09-27 14:00:52 -04:00
parent e82a0c959a
commit c561a625af
2 changed files with 32 additions and 5 deletions

View File

@@ -87,3 +87,7 @@ Bug Fixes
- Fix an assertion failure on an invalid path.
Addresses: https://cygwin.com/ml/cygwin/2019-09/msg00228.html
- If the argument to mkdir(2) or rmdir(2) is 'x:\', don't strip the
trailing backslash.
Addresses: https://cygwin.com/ml/cygwin/2019-08/msg00334.html