From: Houder <houder@xs4all.nl>
To: cygwin@cygwin.com
Cc: eblake@redhat.com
Subject: Re: Odd, is it not? mkdir 'e:\' cannot be undone by rmdir 'e:\' ...
Date: Fri, 30 Aug 2019 12:42:00 -0000 [thread overview]
Message-ID: <4a87b7a940fb0cf76aac5f3bc5b1a8b3@smtp-cloud7.xs4all.net> (raw)
In-Reply-To: <ee1138b29ee4be60d62d86d59f581b2e@smtp-cloud8.xs4all.net>
On Thu, 29 Aug 2019 17:05:41, Houder wrote:
> On Wed, 28 Aug 2019 16:22:20, Corinna Vinschen wrote:
[snip]
> > One problem here is, what to do about border cases like
> >
> > $ mkdir a\/\/\/
> >
> > In theory slashes and backslashes should both be treated as dir
> > separators. Handling a case like this so that all expectations
> > are satisfied is next to impossible, I guess.
>
> How about dropping Eric's code snippet in winsup/cygwin/dir.cc ?????
>
> Subdirectory 'a' is created. No problem there. Perhaps the patch has
> become superfluous/ redundant over time?
>
> I have tried different "values" for the path-argument to mkdir, and
> have not found a problem while the code snippet is being skipped.
>
> What am I missing?
A trailing forward slash in "pathname" is stripped in path_conv::check,
(look for: *--tail = '\0' )
after "pathname" has been normalized in
normalized_posix_path or normalized_win32_path (or both),
before it is fed into conv_to_win32_path.
Tests have shown that Eric's code snippet can be deleted w/o harm.
Counter arguments?
Henri
> -----
> Breakpoint 1 at 0x1800548b9: file /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc, line 317.
> Breakpoint 2 at 0x1800548e3: file /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc, line 326.
> (gdb) r
> Starting program: /usr/bin/mkdir 'a\/\/\/'
> [New Thread 1064.0x1a8c]
> [New Thread 1064.0x59c]
>
> Thread 1 "mkdir" hit Breakpoint 1, mkdir (dir=0x800041320 "a\\/\\/\\/", mode=511)
> at /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc:317
> 317 if (isdirsep (dir[strlen (dir) - 1]))
> (gdb) j dir.cc:326
> Continuing at 0x1800548e3.
>
> Thread 1 "mkdir" hit Breakpoint 2, mkdir (dir=0x800041320 "a\\/\\/\\/", mode=511)
> at /usr/src/debug/cygwin-3.1.0-0.2/winsup/cygwin/dir.cc:326
> 326 if (!(fh = build_fh_name (dir, PC_SYM_NOFOLLOW)))
> (gdb) c
> Continuing.
> [Inferior 1 (process 1064) exited normally]
> (gdb) quit
>
> 64-@@ ls -ld a*
> drwxr-xr-x+ 1 Henri None 0 Aug 29 16:47 a
>
> =====
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2019-08-30 9:54 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 15:25 Houder
2019-08-27 16:28 ` Corinna Vinschen
2019-08-27 17:01 ` Houder
2019-08-27 17:32 ` Vince Rice
2019-08-27 17:50 ` Corinna Vinschen
2019-08-28 7:16 ` Houder
2019-08-28 9:22 ` john doe
2019-08-28 11:47 ` Houder
2019-08-28 13:22 ` Corinna Vinschen
2019-08-28 14:16 ` Eric Blake
2019-08-28 14:22 ` Corinna Vinschen
2019-08-28 15:18 ` Corinna Vinschen
2019-08-29 15:19 ` Houder
2019-08-30 8:20 ` Corinna Vinschen
2019-08-30 12:42 ` Houder [this message]
2019-09-01 17:38 ` Houder
2019-09-02 8:15 ` Corinna Vinschen
2019-09-03 8:40 ` Houder
2019-09-03 6:50 ` Andrey Repin
2019-09-19 19:51 ` Ken Brown
2019-09-20 9:11 ` Houder
2019-09-20 18:20 ` Houder
2019-09-21 16:07 ` Ken Brown
2019-09-22 7:34 ` Houder
2019-09-22 14:12 ` Ken Brown
2019-09-07 3:47 ` L A Walsh
2019-08-27 19:48 ` Achim Gratz
2019-08-27 20:58 ` Brian Inglis
2019-08-28 7:16 ` Corinna Vinschen
2019-08-27 22:21 ` Achim Gratz
2019-08-28 13:36 ` Eric Blake
2019-08-28 22:57 ` Houder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a87b7a940fb0cf76aac5f3bc5b1a8b3@smtp-cloud7.xs4all.net \
--to=houder@xs4all.nl \
--cc=cygwin@cygwin.com \
--cc=eblake@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).