From 552d265b6ced1e56d31f20f16a7fe9ae818d568b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 15 Jan 1997 23:44:39 +0000 Subject: getopt(3) returns -1 when out of args, not EOF, whee! --- bin/sh/histedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/sh/histedit.c') diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 319bd86e33f..1e1da1fd79b 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: histedit.c,v 1.6 1996/10/20 00:54:50 millert Exp $ */ +/* $OpenBSD: histedit.c,v 1.7 1997/01/15 23:40:28 millert Exp $ */ /* $NetBSD: histedit.c,v 1.8 1995/05/11 21:29:12 christos Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: histedit.c,v 1.6 1996/10/20 00:54:50 millert Exp $"; +static char rcsid[] = "$OpenBSD: histedit.c,v 1.7 1997/01/15 23:40:28 millert Exp $"; #endif #endif /* not lint */ @@ -211,7 +211,7 @@ histcmd(argc, argv) optreset = 1; optind = 1; /* initialize getopt */ while (not_fcnumber(argv[optind]) && - (ch = getopt(argc, argv, ":e:lnrs")) != EOF) + (ch = getopt(argc, argv, ":e:lnrs")) != -1) switch ((char)ch) { case 'e': editor = optarg; -- cgit v1.2.3