From nobody Mon Apr 29 20:20:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511458730557519.7159929513416; Thu, 23 Nov 2017 09:38:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD9BC558D6; Thu, 23 Nov 2017 17:38:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C0EB60F89; Thu, 23 Nov 2017 17:38:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 021694BB79; Thu, 23 Nov 2017 17:38:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vANHck4H018363 for ; Thu, 23 Nov 2017 12:38:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 88A5717CC3; Thu, 23 Nov 2017 17:38:46 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E8A86BF8D for ; Thu, 23 Nov 2017 17:38:43 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 23 Nov 2017 18:38:39 +0100 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tools: Work around ancient readline X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 23 Nov 2017 17:38:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" My latest commit of a785186446de785d uncovered a problem we fixed in 9eb23fe2 but then reverted in 834c5720e443. Turns out, some systems (I'm looking at you OS X) have ancient readline with broken header file. Signed-off-by: Michal Privoznik --- Pushed as build breaker. tools/vsh.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 472438ead..e878119b9 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2892,6 +2892,7 @@ vshReadlineInit(vshControl *ctl) int ret =3D -1; char *histsize_env =3D NULL; const char *histsize_str =3D NULL; + const char *break_characters =3D " \t\n\\`@$><=3D;|&{("; =20 /* Opaque data for autocomplete callbacks. */ autoCompleteOpaque =3D ctl; @@ -2900,12 +2901,20 @@ vshReadlineInit(vshControl *ctl) * Work around ancient readline 4.1 (hello Mac OS X), * which declared it as 'char *' instead of 'const char *'. */ +# if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION > 0x0402 rl_readline_name =3D ctl->name; +# else + rl_readline_name =3D (char *) ctl->name; +# endif =20 /* Tell the completer that we want a crack first. */ rl_attempted_completion_function =3D vshReadlineCompletion; =20 - rl_basic_word_break_characters =3D " \t\n\\`@$><=3D;|&{("; +# if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION > 0x0402 + rl_basic_word_break_characters =3D break_characters; +# else + rl_basic_word_break_characters =3D (char *) break_characters; +# endif =20 if (virAsprintf(&histsize_env, "%s_HISTSIZE", ctl->env_prefix) < 0) goto cleanup; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list