www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/30/02:17:58

From: pneyz <pneyz AT bethany DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Runs in Win95, crashes in DOS.
Date: Mon, 29 Dec 1997 22:59:54 -0800
Organization: Smoof Team
Lines: 22
Message-ID: <34A89BEA.141C714@bethany.edu>
NNTP-Posting-Host: scz-ca6-27.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I have DJGPP installed correctly and everything, but a lot of my
programs will only work in Win95, and not in pure DOS. These programs
all make use of command line parameters, and that is where the problem
is manifesting. I managed to narrow it down to the following:

   int main (int argc, char *argv[])
   {
    if (!strcmp(argv[1], "-h")) return 1;
    else return 0;
   }

That should test to see if argv[1] is "-h" and if it is, return 1, and
if not, return 0. This works fine in Win95, but in DOS I get a error
screen about SIGSENT (actually, I'm not too sure about what it says, as
I can't reproduce it in Win95 right now). Any code before that executes
fine, but it stops there. Any help will be much appreciated.

-- 
/*
   pneyz[smoof.ganja]              pneyz AT bethany DOT edu
   "Fine Malt Coding"              http://www.armory.com/~pneyz
*/

- Raw text -


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