delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/24/11:42:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Fri, 24 Oct 2003 11:41:47 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Dylan Cuthbert <dylan AT q-games DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Strange Cygwin issue
In-Reply-To: <bnafo3$50u$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.56.0310241122510.15002@slinky.cs.nyu.edu>
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0305191739530 DOT 26639-100000 AT slinky DOT cs DOT nyu DOT edu>
<ud6ieh7j2 DOT fsf AT boost-consulting DOT com> <bnafo3$50u$1 AT sea DOT gmane DOT org>
Importance: Normal
MIME-Version: 1.0

Dylan,

If you followed that thread to the end, it was suggested that the program
itself was buggy and treated the "-" as a parameter separator, IIRC.

As for your case, that's the expected behavior.  Windows programs get the
quotes surrounding quoted arguments -- try it from cmd.exe with this
simple program:

#include <stdio.h>

#ifdef WIN
#include <windows.h>
int APIENTRY WinMain(HINSTANCE inst, HINSTANCE pinst, LPSTR cmdline, int show) {
  printf ("%s\n", cmdline);
}
#else
int main(int ac, char *av[]) {
  int i;
  for (i = 0; i < ac; i++)
    printf ("%s|", av[i]);
  printf ("\n");
  return 0;
}
#endif

At a guess, the only way you can get around it is by writing your own
command line parsing routines...  Sorry.
	Igor

On Fri, 24 Oct 2003, Dylan Cuthbert wrote:

> Did you sort this problem out eventually?  We're having the same problem.
>
> We pass a DOS command that we've compiled in Vis.C a parameter from within a
> bash shell and all our quotes are "played" with.
>
> ie.   #> ourcommand   'my oh my "this is a string" that is played with'
>
> and we get    "my oh my \"this is a string\" that is played with"
> (including the surrounding double quotes) in our DOS program.
>
> Not what we want really.
>
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com
>
>
> "David Abrahams" <dave at boost-consulting dot com> wrote in message
> news:ud6ieh7j2 DOT fsf AT boost-consulting DOT com...
> > Igor Pechtchanski <pechtcha at cs dot nyu dot edu> writes:
> >
> > > Dave,
> > >
> > > Actually, upon re-reading the above, it looks like it's a bash quoting
> > > issue.  You might try the fix that worked for "cygstart": single quote the
> > > double quotes, e.g.
> > >
> > > tlib '"c:\foo-bar\baz"'
> >
> > I exhausted all obvious possibilites, including that one, before
> > posting here.
> >
> > > or, if you want to be more generic,
> > >
> > > FILENAME=/cygdrive/c/foo-bar/baz
> > > tlib '"'"`cygpath -w "$FILENAME"`"'"'
> > >
> > > Make sure you copy the above *exactly* (better yet, cut/paste).
> > > Hope this helps,
> >
> > No dice:
> >
> >     dave AT penguin /cygdrive/c/boost/tools/build/test
> >     $ foo=/cygdrive/c/foo-bar/baz
> >
> >     dave AT penguin /cygdrive/c/boost/tools/build/test
> >     $ /cygdrive/c/tools/Borland/BCC55/Bin/tlib.exe  '"'"`cygpath -w "$foo"`"'"'
> >     TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
> >
> >     Error: opening '\c:\foo.LIB'
> >
> > The response should look like:
> >
> >     C:\boost\tools\build\jam_src>c:\tools\Borland\BCC55\Bin\tlib.exe "c:\foo-bar\baz"
> >     TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
> >
> >     Error: opening 'c:\foo-bar\baz.LIB'
> >
> > --
> > Dave Abrahams
> > Boost Consulting
> > www.boost-consulting.com

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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