argv[0] needs to be an absolute path

Dan Kegel dank at kegel.com
Fri Jan 3 22:36:11 CST 2003


Uwe Bonnes wrote:
>>>>>>"Dan" == Dan Kegel <dank at kegel.com> writes:
> 
>     Dan> The C program main(int argc, char **argv) { puts(argv[0]); }
>     Dan> outputs an absolute path on Windows, but sometimes outputs a
>     Dan> relative path on Wine.  This causes the commandline $ wine d:setup
>     Dan> to fail to find its files properly if it uses the basename of
>     Dan> argv[0].  One example of this is msvc4.0 (although it only tries
>     Dan> this if an earlier method fails, so there's another bug lurking). ..
> 
>     Dan> The same problem exists for programs launched from other wine
>     Dan> programs, e.g. from inside wcmd.  That's another code path, and I
>     Dan> couldn't find a one-line fix for that one.  - Dan
> 
> Did you check that it is CreateProcess that adds the absolute path? I would
> guess the MS C Library will do it. 

Not quite sure how to check.  Can you suggest a way?

 > Fiddling with CreateProcess needs good throught.

I have not as yet fiddled with CreateProcess, only with the
code that starts off the initial process when you run Wine,
I think.

- Dan

-- 
Dan Kegel
Linux User #78045
http://www.kegel.com




More information about the wine-devel mailing list