Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <17B78BDF120BD411B70100500422FC6309E10F@IIS000> From: Bernard Dautrevaux To: "'cygwin AT sources DOT redhat DOT com'" , cygwin AT sourceware DOT cygnus DOT com Subject: RE: Strange cd/CDPATH behavior Date: Tue, 26 Sep 2000 20:15:30 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" > -----Original Message----- > From: Chris Faylor [mailto:cgf AT cygnus DOT com] > Sent: Tuesday, September 26, 2000 7:56 PM > To: cygwin AT sourceware DOT cygnus DOT com > Subject: Re: Strange cd/CDPATH behavior > > > On Tue, Sep 26, 2000 at 11:40:54AM -0600, Erik Nolte wrote: > >> > The obvious answer is to stop using DOS style paths with > cygwin cd's. > >> > Unfortunately, what I'm really doing is "cd $SRC_PATH" > where SRC_PATH is > >> > "W:/src". SRC_PATH must be a DOS style path to keep > javac and other > >> > windows-based software happy (they can't grok paths without drive > >> letters). > >> > >> Use cygpath... > >> >cygpath -u -p c:/ > >> / > >> > >> In your example, something like: > >> cd $(cygpath -u -p $SRC_PATH) > >> would probably work. > > > > > >I wish I could, unfortunately the cd's are inside makefiles > and scripts that > >run both on cygwin/NT/Win2K and on Solaris. And the Suns > aren't too happy > >about cygpath. I can hack around the problem by unsetting CDPATH or > >creating a SHELL_SRC_PATH (/c) and a APP_SRC_PATH (c:/). ... > > FWIW, I haven't seen anyone mention that this is a *bash* > idiosyncrasy. Bash is > apparently not dealing well with c:\foo style paths, which is > hardly surprising. We had the same kind of problems in our port of UNIX tools to Windows (having the tools correctly handling X:/foo as an absolute path) and the only solution we found was looking at all the places in our source code base where we compare something with '/' then manually check iw we were looking for an absolute path, then if true recode it to call some locally defined macro (IS_ABSOLUTE_PATH) that depending on the platform either check the first char (on UNIX) or call some function that is able to handle drive letters correctly ;-( We were quite reluctant at having to do that but we do not find any other way to handle correctly DOS-style path names. Note that we even have more hard time trying to handle DOS-style path names in UNIX-style (':'-separated) path lists, but this is another story :-) (I can describe how we do that if anybody is interested). > > I doubt that these problems show up in Solaris since there is > no possibility > that you'll ever see a x:\ path there. I think what he wants to say is that he can't rewrite its makefile rules using cd `cygpath ${SRC_DIR}` as Solaris will choke on cygpath :-) and he has to have the same makefiles for UNIX and CYGWIN (after all this *was* the reason of creating cygwin: be able to port UNIX packages to Windows). Just my .02EUR Bernard -------------------------------------------- Bernard Dautrevaux Microprocess Ingenierie 97 bis, rue de Colombes 92400 COURBEVOIE FRANCE Tel: +33 (0) 1 47 68 80 80 Fax: +33 (0) 1 47 88 97 85 e-mail: dautrevaux AT microprocess DOT com b DOT dautrevaux AT usa DOT net -------------------------------------------- -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com