Source-Changes-HG archive

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

[src/trunk]: src/bin/sh When we initialize libedit (editline) always call our...



details:   https://anonhg.NetBSD.org/src/rev/b8e6b3a37e13
branches:  trunk
changeset: 359922:b8e6b3a37e13
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jan 31 18:15:45 2022 +0000

description:
When we initialize libedit (editline) always call ourselves "sh" no
matter what $0 is (or is not) set to.   This means that editrc(5)
lines that start "sh:" are used (in addition to those with no prefix,
which will usually be most of them), regardless of the name or manner in
which we were invoked.

OK christos@

diffstat:

 bin/sh/histedit.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r ba03e6453b18 -r b8e6b3a37e13 bin/sh/histedit.c
--- a/bin/sh/histedit.c Mon Jan 31 17:23:37 2022 +0000
+++ b/bin/sh/histedit.c Mon Jan 31 18:15:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: histedit.c,v 1.58 2022/01/31 16:54:28 kre Exp $        */
+/*     $NetBSD: histedit.c,v 1.59 2022/01/31 18:15:45 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.58 2022/01/31 16:54:28 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.59 2022/01/31 18:15:45 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -115,7 +115,7 @@
                        /*
                         * turn editing on
                         */
-                       char *term, *shname;
+                       char *term;
 
                        INTOFF;
                        if (el_in == NULL)
@@ -151,10 +151,7 @@
                                setenv("TERM", term, 1);
                        else
                                unsetenv("TERM");
-                       shname = arg0;
-                       if (shname[0] == '-')
-                               shname++;
-                       el = el_init(shname, el_in, el_out, el_err);
+                       el = el_init("sh", el_in, el_out, el_err);
                        if (el != NULL) {
                                if (hist)
                                        el_set(el, EL_HIST, history, hist);



Home | Main Index | Thread Index | Old Index