Re: Still no luck on command line parse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 3 Feb 2002, Francois Gouget wrote:

> > main gets it as constructed by the C runtime, isn't it?
>
>    Which main?
>  * the main of a Unix application. The C runtime invokes main so it gets
> the pointers from it after a fashion. But I am pretty sure these point
> to a memory block that was initialized by the kernel itself
>  * the main of a Winelib application. This one gets it from Wine. More
> precisely it gets it from scheduler/process.c:build_argv()
>  * and the WinMain of a Winelib application gets its command line from
> memory/environ.c:ENV_BuildCommandLine(), which builds it from the result
> of build_argv()
>
The main of a windows C program, I mean.  Well, lcclnk.exe produces PE
executables, so I guess that is what it is.  Its main gets whatever
lcccrt0.o sees fit to give it, I think.
>
>    If you have a 'z:' drive that points to /, then the first path is
> valid. Except if Wine changes the current drive or chooses another
> current driver for some reason... For instance here /home/fgouget
> corresponds to y:\ and z:\home\fgouget so I am not sure which one Wine
> would actually choose on startup. And if it chooses y:\, then
> /home/fgouget/foo.exe would not be a valid path anymore.
>
Well, /home/whit/cmdl is H:, and /gp/windose is C:, but what goes in
GetCommandLine() and argv[0] is what was on the unix command line.
If we wanted to try to idiot-proof the thing, maybe we would convert it
to a windows path, but that way lies madness.  If my damned app wants to
parse the command line, I don't see why I shouldn't give it a command
line it can parse.  Maybe something to that effect should go into the
doco.
>
> --
> Francois Gouget         fgouget@free.fr        http://fgouget.free.fr/
>      The software said it requires Win95 or better, so I installed Linux.
>
Lawson

It is impossible to make anything foolproof because fools are so
ingenious.


_______________________________________________
wine-users mailing list
wine-users@winehq.com
http://www.winehq.com/mailman/listinfo/wine-users

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux