Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh After (a few days short of) 21 years, revert 1.25, wh...



details:   https://anonhg.NetBSD.org/src/rev/66c0bdc1aaa6
branches:  trunk
changeset: 359950:66c0bdc1aaa6
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Feb 02 01:21:34 2022 +0000

description:
After (a few days short of) 21 years, revert 1.25, which did nothing except
make the -e option to "fc" fail to work (the commit message was about some
other changes entirely, so I an only assume this was committed by mistake).

It says a lot about the use of the fc command that no-one noticed that
this did not work properly for all this time.

Internally in sh, it is possible for built in commands to use either
getopt(3) (from libc) or the much simpler internal shell nextopt() routine
for option (flag) parsing.    However it makes no sense to use getopt()
and then access a global variable set only by nextopt() instead of the
one getopt() sets (which is what the code had used previously, forever).

Use the correct variable again.

XXX pullup -9 -8  (-7 -6 -5 ...)

diffstat:

 bin/sh/histedit.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c2b019a2969b -r 66c0bdc1aaa6 bin/sh/histedit.c
--- a/bin/sh/histedit.c Tue Feb 01 18:27:24 2022 +0000
+++ b/bin/sh/histedit.c Wed Feb 02 01:21:34 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: histedit.c,v 1.59 2022/01/31 18:15:45 kre Exp $        */
+/*     $NetBSD: histedit.c,v 1.60 2022/02/02 01:21:34 kre Exp $        */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.59 2022/01/31 18:15:45 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.60 2022/02/02 01:21:34 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -318,7 +318,7 @@
              (ch = getopt(argc, argv, ":e:lnrs")) != -1)
                switch ((char)ch) {
                case 'e':
-                       editor = optionarg;
+                       editor = optarg;
                        break;
                case 'l':
                        lflg = 1;



Home | Main Index | Thread Index | Old Index