From: dbe AT wgn DOT net ("$Bill Luebkert") Subject: Re: `find' command broken. 12 Jul 1997 22:31:20 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <33C85B70.19BE.cygnus.gnu-win32@wgn.net> References: <19970711092719531 DOT AAA303 AT TENDLE> <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> Reply-To: dbe AT wgn DOT net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01Gold (Win95; I) Original-To: Fergus Henderson Original-CC: gnu-win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com 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? Another possibility would be to look at the code in globify: for (i = 0; i < ac; i++) { if (strpbrk (av[i], "?*[") != NULL) { globs[i].gl_offs = 0; rc[i] = glob (av[i], GLOB_NOCHECK | GLOB_NOESCAPE, 0, &globs[i]); newac += rc[i] == 0 ? globs[i].gl_pathc : 1; donesomething = rc[i] == 0; } else { rc[i] = -1; /* glob not called */ ++newac; } } -------------------------------------------------------- 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 */ } /* rest of original glob code below */ Or something similar. That would seem more reasonable for checking globs or anything embedded in quotes. -- ,-/- __ _ _ $Bill Luebkert (_/ / ) // // DBE Collectibles / ) /--< o // // http://www.wgn.net/~dbe/ -/-' /___/_<_