Re: Does getopt() return "-1", or "EOF", at end? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Does getopt() return "-1", or "EOF", at end?
Date
Msg-id Pine.LNX.4.30.0201091604370.734-100000@peter.localdomain
Whole thread Raw
In response to Does getopt() return "-1", or "EOF", at end?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> I notice that in some places we compare the result of getopt(3) to
> "EOF", and in some other places we compare it to "-1".  I think we
> should standardize on one or the other; anyone have an opinion
> which it should be?

Definitely "-1", since getopt() comes from unistd.h and EOF is in stdio.h
so EOF is not necessarily available unless the program does stream-based
I/O.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Does getopt() return "-1", or "EOF", at end?
Next
From: Bruce Momjian
Date:
Subject: Re: Does getopt() return "-1", or "EOF", at end?