Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Message-ID: <005c01bfeede$10604c00$f7c723cb@lifelesswks> From: "Robert Collins" To: "Chris Faylor" , "cygapp" References: <004801bfeed8$5a75f610$f7c723cb AT lifelesswks> <20000715234510 DOT A8476 AT cygnus DOT com> Subject: Re: two questions Date: Sun, 16 Jul 2000 14:26:50 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sorry, I should explain more exec("C:/cygwin/usr/local/program.exe") fails exec("C:\\cygwin\usr\local\program.exe") works (\\ c-style escaped) and program.exe receives the first format from start|run, and from shortcuts, or double-clicking on a program. So having a program that calls exec based in it's own path will need an library call equivalent to cygpath -u (which looks to be cygwin_conv_to_posix_path(name, convertedname), or for argv[0] to be a little more consistent. I've put cygwin_conv_to_posix_path in the program I'm working on, All i'm saying is that a longer term solution might be to put something in the startup code.. Rob ----- Original Message ----- From: "Chris Faylor" To: "cygapp" Sent: Sunday, July 16, 2000 1:45 PM Subject: Re: two questions > On Sun, Jul 16, 2000 at 01:45:56PM +1000, Robert Collins wrote: > >1)Start|run, c:\cygwin\usr\local\program.exe > >2)start|run, cmd (running win2k). then (from any drive) > >"c:\cygwin\usr\local\program.exe" > > > >in 1, argv[0] is C:/cygwin/usr/local/program.exe > >in 2, argv[0] is /usr/local/program.exe > > > >Note that bash was not the shell in 2! I'm quite happy to code around this > >myself, but if someone wanted to provide a pointer as to where I should > >place it I'm happy to code around it for cygwin.. > > > >The reason it's a issue, is that I want to call exec(argv[0],newswitches), > >which the above behaviour scuttles.. > > Why? > > cgf >