www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/27/11:45:43

Date: Tue, 27 Oct 1998 11:44:06 -0500 (EST)
Message-Id: <199810271644.LAA05516@indy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <3635f355.0@scooby.nildram.co.uk> (gfenwick@BYESPAMprimex.co.uk)
Subject: Re: /? command line args being altered by DJGPP
Reply-To: djgpp AT delorie DOT com

> Put simply, I've written (part of a) program to parse command line
> arguments, and it's running into trouble when I try to read the arguments
> "/?", "/??", "/???" and so on. For some reason, the argument is sometimes
> being converted into what seems like a directory name(!), so the program
> itself isn't reading the argument as "/?".

Yup.  DJGPP uses a unix-based compiler, and applies unix-style
wildcard expansion to command-line arguments.  You can stop this by
reading the libc reference guide[1] and providing your own "glob
function" that does no expansion.  You can use glob() to later expand
wildcards that you need expanded.

Note that the "unix standard" for options uses dashes, not slashes,
and the one for help is "-h" instead of "/?".

[1] http://www.delorie.com/djgpp/doc/libc-2.01/libc_106.html

- Raw text -


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