Mail Archives: djgpp/1998/04/20/09:05:46
On Mon, 20 Apr 1998, Andrew McLean wrote:
> When I look at 'argv[0]', I expect to see the fully-qualified filename
> of my executable. I do, but the separators are Unix-style
> '/' instead of DOS-style '\'.
> Is there a switch to correct this ?
First, you need to decide whether this at all matters. Many people don't
realize that DOS can handle file names with forward slashes as well as
those with backslashes. So if you only need argv[0] to generate a file
name which will then be used in some DOS call, you don't need to convert
them at all.
If you do need to have the DOS-style backslashified argv[0], set the
_CRT0_FLAG_USE_DOS_SLASHES bit in the _crt0_startup_flags variable. This
is described in detail in the libc docs, under _crt0_startup_flags.
- Raw text -