From owner-dev-commits-src-main@freebsd.org Thu Aug 19 04:58:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF25465D7AE; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GqsxH3LJ8z3Csj; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8FF1F373; Thu, 19 Aug 2021 04:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17J4wx7A014248; Thu, 19 Aug 2021 04:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17J4wxDY014247; Thu, 19 Aug 2021 04:58:59 GMT (envelope-from git) Date: Thu, 19 Aug 2021 04:58:59 GMT Message-Id: <202108190458.17J4wxDY014247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 35b253d9d238 - main - sh: fix NO_HISTORY build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35b253d9d238c46a710a0cd7ba027ec87ba7c8ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 04:58:59 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=35b253d9d238c46a710a0cd7ba027ec87ba7c8ba commit 35b253d9d238c46a710a0cd7ba027ec87ba7c8ba Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-18 20:40:39 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-08-19 04:57:06 +0000 sh: fix NO_HISTORY build Move code added in b315a7296d2a ("autocomplete commands") to conditionally compiled part under #ifndef NO_HISTORY. Reported by: bdrewery Fixes: b315a7296d2a --- bin/sh/histedit.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 596145790f31..bd82016c33cb 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -565,27 +565,6 @@ bindcmd(int argc, char **argv) return ret; } -#else -#include "error.h" - -int -histcmd(int argc __unused, char **argv __unused) -{ - - error("not compiled with history support"); - /*NOTREACHED*/ - return (0); -} - -int -bindcmd(int argc __unused, char **argv __unused) -{ - - error("not compiled with line editing support"); - return (0); -} -#endif - /* * Comparator function for qsort(). The use of curpos here is to skip * characters that we already know to compare equal (common prefix). @@ -706,3 +685,24 @@ sh_complete(EditLine *sel, int ch __unused) L" \t\n\"\\'`@$><=;|&{(", NULL, NULL, (size_t)100, NULL, &((int) {0}), NULL, NULL, FN_QUOTE_MATCH); } + +#else +#include "error.h" + +int +histcmd(int argc __unused, char **argv __unused) +{ + + error("not compiled with history support"); + /*NOTREACHED*/ + return (0); +} + +int +bindcmd(int argc __unused, char **argv __unused) +{ + + error("not compiled with line editing support"); + return (0); +} +#endif