From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 15 15:10:09 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF54F1065680 for ; Wed, 15 Aug 2012 15:10:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 89EE98FC12 for ; Wed, 15 Aug 2012 15:10:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7FFA9pq055585 for ; Wed, 15 Aug 2012 15:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7FFA9T0055584; Wed, 15 Aug 2012 15:10:09 GMT (envelope-from gnats) Resent-Date: Wed, 15 Aug 2012 15:10:09 GMT Resent-Message-Id: <201208151510.q7FFA9T0055584@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Steffen "Daode" Nurpmeso Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7144B106566C for ; Wed, 15 Aug 2012 15:03:22 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 436848FC18 for ; Wed, 15 Aug 2012 15:03:22 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7FF3Mc4088362 for ; Wed, 15 Aug 2012 15:03:22 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q7FF3LaG088361; Wed, 15 Aug 2012 15:03:21 GMT (envelope-from nobody) Message-Id: <201208151503.q7FF3LaG088361@red.freebsd.org> Date: Wed, 15 Aug 2012 15:03:21 GMT From: Steffen "Daode" Nurpmeso To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/170651: On 9.0-RELEASE#0 and master sh(1) gobbles high bit at first X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2012 15:10:10 -0000 >Number: 170651 >Category: bin >Synopsis: On 9.0-RELEASE#0 and master sh(1) gobbles high bit at first >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 15 15:10:09 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Steffen "Daode" Nurpmeso >Release: 9.0-REALEASE, and git master branch >Organization: >Environment: >Description: Hm, i was a bit late yesterday and am subscribed to no list around here which seemed to be sufficient, so i've subscribed to bugs@ and confirmed and send my mail. It seems this list is usually driven by a tracker.. So, then. If /bin/sh is the login shell, starting it won't allow input of german umlauts in ISO8859-15 locale with fonts plus well set up. Issue a set with arguments ($set +o, $set -o), and it'll work as expected. >How-To-Repeat: Start a shell. >Fix: So it turns out the problem is the histedit() function. If it isn't called from within optschanged() then everything is fine. Now i've spend some hours trying to adjust that, but i've no idea on sh(1) and libedit(3) internals, so i still don't understand the problem, though i've found a getaround. The problem occurs when 'el' must be initialized. If that actually happens (upon sh(1) startup), then it'll change handling of the high bit (or say, i'm just fiddling around with german umlauts here). I've split up histedit() in individual parts, i've used sleeps and recursive calls and whatever, but it didn't help. The only solution i've found is to call histedit() from within main() again (or outsource the pure initialization code to histedit_init(), but anyway call it once from within main()). I've no idea if that may have side-impacts, but applying the patch fixes the issue for me. This patch applies to the master branch of git://git.freebsd.org/freebsd. So sorry for the mail yesterday. And how can i Cc: jilles@ and pfg@ from within this tracker now?? --steffen Patch attached with submission follows: diff --git a/bin/sh/main.c b/bin/sh/main.c index 5eb12e0..99f9d5e 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -73,6 +73,9 @@ __FBSDID("$FreeBSD$"); #include "exec.h" #include "cd.h" #include "builtins.h" +#ifndef NO_HISTORY +# include "myhistedit.h" +#endif int rootpid; int rootshell; @@ -164,6 +167,11 @@ state2: read_profile(shinit); } } + /* Fix issue with gobbled high bits */ +#ifndef NO_HISTORY + if (iflag) + histedit(); +#endif state3: state = 4; popstackmark(&smark2); >Release-Note: >Audit-Trail: >Unformatted: