delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/13/01:35:36

From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson)
Subject: Re: `find' command broken.
13 Jul 1997 01:35:36 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199707130736.RAA03125.cygnus.gnu-win32@murlibobo.cs.mu.OZ.AU>
References: <19970711092719531 DOT AAA303 AT TENDLE> <BMSMTP8686333710a0207776 AT dlemail DOT itg DOT ti DOT com> <19970711133409718 DOT AAA335 AT TENDLE> <33C6B5BF DOT BA9 AT wgn DOT net> <33C76150 DOT A2F58F7F AT prairienet DOT org> <33C79F98 DOT 101D AT wgn DOT net> <199707121814 DOT EAA04604 AT murlibobo DOT cs DOT mu DOT OZ DOT AU> <33C85B70 DOT 19BE AT wgn DOT net>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

"$Bill Luebkert" <dbe AT wgn DOT net> wrote:

>Fergus Henderson wrote:
>> 
>> 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.
>
>And I suppose command.com etc. all need to be re-compiled 
>against gnuwin32?

Well, command.com doesn't do any globbing, so there's no problem
with double-globbing: things get globbed only once, by cygwin.dll.

There may be some problem with escaping or quoting, though.
Does command.com do anything special with quotes?

>Another possibility would be to look at the code in globify:
....
>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.

--
Fergus Henderson <fjh AT cs DOT mu DOT oz DOT au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019