From owner-freebsd-hackers Sat Sep 28 21:01:29 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id VAA29085 for hackers-outgoing; Sat, 28 Sep 1996 21:01:29 -0700 (PDT) Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA29023 for ; Sat, 28 Sep 1996 21:01:24 -0700 (PDT) Received: from rover.village.org (localhost [127.0.0.1]) by rover.village.org (8.7.6/8.6.6) with ESMTP id WAA01076; Sat, 28 Sep 1996 22:01:16 -0600 (MDT) Message-Id: <199609290401.WAA01076@rover.village.org> To: Thomas David Rivers Cc: hackers@freebsd.org Subject: Re: Quick question about getopt In-reply-to: Your message of "Sat, 28 Sep 1996 21:09:08 EDT." <199609290109.VAA00302@lakes.water.net> References: <199609290109.VAA00302@lakes.water.net> Date: Sat, 28 Sep 1996 22:01:16 -0600 From: Warner Losh Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199609290109.VAA00302@lakes.water.net> Thomas David Rivers writes: : > : > NetBSD's getopt returns -1, while FreeBSD documents it as returning : > EOF. NetBSD's appears to be the same as 4.4 lite 2. I was curious as : > to why the difference between the two existed. The CVS tree is : > unenlightening when I asked it for a revision history. : : Hmmm.... I don't mean to point out what may be the obvious, but isn't : EOF == -1? Yes. However, the NetBSD doc specifically says that getopt returns -1 and the FreeBSD doc says EOF. While they are both the same in this implementaiton, pedantically, FreeBSD should use -1. This change won't break anything, since EOF does == -1 (assuming that other lite2 deltas don't impact this). Warner