This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: `find' command broken.


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/
-/-' /___/_<_</_</_    Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]