delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/20/09:05:46

Date: Mon, 20 Apr 1998 16:04:12 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Andrew McLean <andrew_mclean AT hp DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Separators wrong in argv[0] ?
In-Reply-To: <353B0E64.2FDA4E81@hp.com>
Message-ID: <Pine.SUN.3.91.980420155938.27814A-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019