www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/06/15/02:55:13

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Tue, 15 Jun 1999 08:59:55 +0200 (CEST)
From: Pontus Lidman <pontus AT mathcore DOT com>
X-Sender: pontus AT atlas DOT mathcore DOT se
To: Earnie Boyd <earnie_boyd AT yahoo DOT com>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: How to use g++ when paths contain spaces?
In-Reply-To: <19990614205353.25590.rocketmail@web135.yahoomail.com>
Message-ID: <Pine.LNX.4.05.9906142311590.16945-100000@atlas.mathcore.se>
MIME-Version: 1.0
Sender: Pontus Lidman <pontus AT mathcore DOT se>


On Mon, 14 Jun 1999, Earnie Boyd wrote:

> --- Pontus Lidman <pontus AT mathcore DOT com> wrote:
> > Hello,
> > 
> > I can't seem to get my command lines or makefiles right when the path to
> > my include directories contain spaces.
[snip]
> 
> Character quoting using the DOS shell uses the ^ character.  If you execute
> your commands in the bash shell the you can use the \ character.
> 
> I as a manager wouldn't ever allow a space in a directory or file name.  It
> causes too many headaches.  The FAQ also warns of the dangers of the space in
> file names.  I suggest that you modify the spaces to _ or -.  Or in the case of
> "include dir" change it to "include".

I totally agree about spaces in path names, but for a variety of reasons I
need to access files from another application that the user might
have installed under "Program Files".

I tried using ^ to escape spaces but it doesn't seem to work the way I
hoped it would:

int main(int argc,char **argv) {
  int i;
  for (i=0; i<argc; i++) printf("'%s'\n",argv[i]);
}

c:\temp>a.exe a^ b
a.exe a^ b
'a.exe'
'a'
'b'

c:\temp>a.exe "a b"
a.exe "a b"
'a.exe'
'a b'

I had hoped these examples would give the same output.

I also gathered that the mingw32 port of 'make' would call sh.exe (if
available) to execute its command lines, so I tried putting the cygwin
sh.exe in the mingw32 bin directory and used standard sh quoting, but I
still got the same behaviour as before.

I guess I lose?

Regards,

Pontus Lidman




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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