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[2]: globbing feature in 17.1 when not under bash issue (b



Text item: 

I agree. I have just been looking at the code in .....
   cdksrc/winsup/dcrt0.cc  where the globing takes place.

There is code to "de-quote" and double quoted string in all cases when
argc/argv is being created and code to glob if not invoked under another 
cygwin32 app. The problem is, these are done in this order and in 2 
different routines.  My take at it is that the shell (bash) removes the 
outer set of quotes 'barfl more' or "bore me to" (assume normal unix 
behavior right?) and then calls the app with these sanitized strings. 
Thus the normal take would be to do no quote handling at all in the 
under-bash condition. However, if not, then should do whatever and as 
much as you want that the shell would have done had it been there:
  1: quote removal
  2: environ string expansion
  3: globing
  4: more?
I am hard pressed to find an elegant (read simple) way to convey that 
the argv entry was quoted after leaving the "build_argv" routine and as 
it goes into the "globify".  I vote for sending in the flag
 u->self->cygwin_parent_p  (set only if spawned from another cygwin app 
I assume) and combining the build_argv and globify into one routine.

I do it. You doit. Other ideas?
    Dave Ellis


______________________________ Reply Separator _________________________________
Subject: Re: globbing feature in 17.1 when not under bash issue (bug)
Author:  jqb@netcom.com at SMTPGATE
Date:    2/22/97 1:08 PM


Sergey Okhapkin wrote:
>
> David Ellis wrote:
> > that quoting of arguments was overlooked. Here is the test case 
> >
> >   find . -name '*.doc'
> >
> > Works great under bash but does a glob under cmd.exe and comes up 
> > with an effective comand line like:
> >   find . -name barf.doc two.doc more.doc

Not with single quotes it doesn't.

> In the last case globbing is performed by cmd.exe.

Huh? cmd.exe does not do globbing.  Under DOS/Windows, globbing 
is up to the individual commands to do.

David Ellis is right that cygwin doesn't handle quotes properly, 
but he's wrong about the argument being expanded in single quotes.

Under cmd.exe:

 ls *.doc    -> a.doc b.doc c.doc

 ls "*.doc"  -> a.doc b.doc c.doc
    BOGUS cygwin expands

 ls '*.doc'  -> ls '*.doc': no such file or directory
    BOGUS cygwin fails to strip single quotes

--
<J Q B>

Text item: External Message Header

The following mail header is for administrative use
and may be ignored unless there are problems.

***IF THERE ARE PROBLEMS SAVE THESE HEADERS***.

Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
References: <01BC20F1.2025DA10@sos>
Subject: Re: globbing feature in 17.1 when not under bash issue (bug)
CC: "gnu-win32@cygnus.com" <gnu-win32@cygnus.com>,
        "'David Ellis'" <dg_ellis@ccm.jf.intel.com>
To: Sergey Okhapkin <sos@prospect.com.ru>
MIME-Version: 1.0
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Organization: JQB Enterprises
From: Jim Balter <jqb@netcom.com>
Date: Sat, 22 Feb 1997 13:08:04 -0800
Message-ID: <330F6034.67A9@netcom.com>
Received: from sba-ca1-16.ix.netcom.com(204.32.201.48) by dfw-ix14.ix.netcom.com
 via smap (V1.3)
     id sma023365; Sat Feb 22 15:10:01 1997
Received: (from smap@localhost)
          by dfw-ix14.ix.netcom.com (8.8.4/8.8.4)
       id PAA23390; Sat, 22 Feb 1997 15:10:09 -0600 (CST)
Received: from dfw-ix14.ix.netcom.com (dfw-ix14.ix.netcom.com [206.214.98.14])
          by ormail.intel.com (8.8.4/8.8.4) with ESMTP
       id NAA10494 for <dg_ellis@ccm.jf.intel.com>; Sat, 22 Feb 1997 13:17:55 -0
800 (PST)
Received: from ormail.intel.com (ormail.intel.com [134.134.248.3]) by relay.jf.i
ntel.com (8.7.6/8.7.3) with ESMTP id NAA12839 for <dg_ellis@ccm.jf.intel.com>; S
at, 22 Feb 1997 13:18:04 -0800 (PST)
Return-Path: jqb@netcom.com
-
For help on using this list, 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]