delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/09/18/18:41:24

Date: Fri, 18 Sep 92 17:27:21 CDT
From: "George Jetson" <pynq AT midway DOT uchicago DOT edu>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Something about DEBUG32...

Here is a fragment of a program:

    if (*argv && !freopen(*argv++,"r",stdin))
        perror(argv[-1]),
        exit (1);

    if (isatty(0))
        fputs("\nCan't handle stdin as a tty!\n",stderr),
        exit (1);

Seems pretty clear, and when I run this under GO32, I get the expected
result.  I.e., if *argv == 0, you get "Can't handle...", if *argv is a
file that exists, all is fine, else you get a "file not found" msg from
the freopen() [Actually, of course, from the perror()].

But, when I run it under DEBUG32, and the file exists, I still get an
abort for "Can't handle..."

(This is with the latest DJGPP, GO32, etc)

- Raw text -


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