From: John.Cooper@digitivity.com ("John Cooper")
Subject: Re: `find' command broken.
14 Jul 1997 02:56:14 -0700
Sender: mail@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <19970714091909312.AAA68.cygnus.gnu-win32@TENDLE>
References: <19970711092719531.AAA303@TENDLE>
	<BMSMTP8686333710a0207776@dlemail.itg.ti.com>
	<19970711133409718.AAA335@TENDLE>
	<33C6B5BF.BA9@wgn.net>
	<33C76150.A2F58F7F@prairienet.org>
	<33C79F98.101D@wgn.net>
	<199707121814.EAA04604@murlibobo.cs.mu.OZ.AU>
	<33C85B70.19BE@wgn.net>
	<199707130736.RAA03125@murlibobo.cs.mu.OZ.AU>
Reply-To: john.cooper@digitivity.com
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-To: Fergus Henderson <fjh@cs.mu.OZ.AU>
Original-Cc: gnu-win32@cygnus.com, Amol Deshpande <amold@microsoft.com>
In-Reply-To: <199707130736.RAA03125@murlibobo.cs.mu.OZ.AU>
X-Mailer: VM 6.32 under Emacs 19.34.1
X-Attribution: JSC
X-Face: -%]aecOJlhOSKn)}>~DbRQwM6G6gDkOD{2f!2Bt9|S-xC1~Gk^dCp_/HH#zo^u5z8iGty3N
 L_1.GYkj0by`^VQK14EzbsY~BC%%O#x+[Giaf?X`hi9H)oEy]M>cx/Y4.I^5@^#kQrJk*!DwlpX: 1}
 eZVU9: ~_QGIMF5[I
Original-Sender: owner-gnu-win32@cygnus.com

Fergus Henderson writes:
 > >> The relevent source is winsup/dcrt0.cc,
 > >> which contains the startup code for cygwin.dll:
 > >> 
 > >>           /* Expand *.c, etc.  */
 > >>           if (! u->self->cygwin_parent_p)
 > >>             globify (&argc, &argv);
 > >> 
 > >> So, the problem with `zsh' commands being doubly-globbed could
 > >> presumably be fixed by recompiling zsh with gnu-win32.

Great, the mystery seems to be explained...

 > >This code doen't check for any escapes.  It just checks for 
 > >globbing characters.  Couldn't this be made to ignore args 
 > >with ' or " as the first char, by inserting this code.
 > >
 > >    if (av[i][0] == '\'' || av[i][0] == '"')
 > >      {
 > >        /* strip quotes off arg here (front and back) and adjust arg ptr */
 > >      }
 > 
 > Yep, that would be a good idea.
 > 
 > But if zsh was not compiled with cygwin, then you would still need
 > to do some gnarly quoting to get it right, e.g.
 > 
 > 	find . -name '"*.c"' -print
 > or
 > 	find . -name "'*.c'" -print
 > 
 > You would need two levels of quotes, because one would get stripped
 > away by zsh, and one by cygwin.dll.


How about introducing an environment variable that means "don't have cygwin
glob", and modify the above code as follows:

 > >>           /* Expand *.c, etc.  */
 > >>           if (! u->self->cygwin_parent_p && !getenv("CYGWIN_DONT_GLOB"))
 > >>             globify (&argc, &argv);

Then I could just set CYGWIN_DONT_GLOB in my .zshrc and find, etc would
behave the same as bash.

It's a bit of a hack, but if the quoting problem is too gnarly, perhaps it
would suffice (at least as a short-term solution).

Thanks,

    --- John

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
