From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10059 invoked from network); 8 Dec 2023 18:29:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Dec 2023 18:29:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=k/FGTgk327GdhByp/uqFotiV6SL+JwHQIdjhZi8izbs=; b=d1LS2Sj9WVMAVnAYeM4vWUq1LT AjeRrMch4zKkQyA1AJB95TfLcXJn4wgaN6cyxEEkFl2vqukqrE51YABy1B2BKE642MlSTTJqHISYa 3DdG3OJwb8p1oeiG74R9x77gMzPd09ej8s91btC2+oB4xlz5Ucu7XzSgH7fJTTU+MlSehRYqP9+8L lolXydqQOfms8NQtNdOTb84ozcLq2Yv+JbC6KskBXuaa1ic6yHvm54uKWeYn1uZjH2WSkv4Uph80N w3byXBMaD/AF+Q/6lxqAVok/erZrGoTZGsPfWqlyRmoznr4Plevr3RCpbkcJp+4QteQfCkSG3PfjV f7yHJ2WQ==; Received: by zero.zsh.org with local id 1rBfbj-000LLC-JT; Fri, 08 Dec 2023 18:29:51 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rBfan-000L3G-WD; Fri, 08 Dec 2023 18:28:54 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1rBfam-000DEk-PE for zsh-workers@zsh.org; Fri, 08 Dec 2023 19:28:52 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: Avoid \e in C code; building on Solaris 11 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <50884.1702060132.1@hydra> Date: Fri, 08 Dec 2023 19:28:52 +0100 Message-ID: <50885-1702060132.779123@YSiF.CgC_.vGLi> X-Seq: 52382 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: A couple of uses of the non-standard \e in C strings have crept into the code in relatively recent patches. Most modern compilers support this but the Solaris compiler doesn't and \033 should be used instead. Incidentally, .sh.edmode doesn't appear to work on any system in my testing, even on other platforms. I get an empty variable and ${#.sh.edmode} remains zero. The change to makepro.awk in 44637 also means that AWK=gawk is needed with the configure script on Solaris. Even before, I tended to use AWK=nawk and as it silences an ugly warning on modern systems I wouldn't back that patch out. Annoyingly, it does leave a size zero Src/builtin.syms and make clean then doesn't delete that (it fails) and a subsequent attempt with gawk then fails to compile builtin.c. For GNU make there is a .DELETE_ON_ERROR: target that would solve that but I can't see an equivalent for Sun make. The test cases now expect diff to have a -a option which it doesn't on Solaris. That was changed in ztst.zsh in 2017 and I don't see much need to change this. B03print fails on Tab expansion by print. This is because the test expects tr '\0' Z to work which it doesn't. Neither does the full octal '\000' or $'\0'. I'm not clear on what purpose that trailing null has for the test but it is commented with "regression test for multibyte tab expand". /dev/fd tests are being skipped because it doesn't detect /dev/fd. That test is: echo ok|(exec 3<&0; cat /dev/fd/3 2>/dev/null;) It works with bash or zsh on Solaris 11 but not with sh or ksh On Solaris 10, it does work with /bin/sh (just not with ksh) Any idea why the use of fd 3 is needed in our test? It works with just: echo ok|(cat /dev/fd/0 2>/dev/null;) I've tried a few variations such as (/bin/echo ok;sleep 1)| without success. Aside from that, there are a couple of failures in W02jobs which I can't repdroduce outside of the test system. Oliver diff --git a/Src/Modules/ksh93.c b/Src/Modules/ksh93.c index 51999dd71..9af5e1d69 100644 --- a/Src/Modules/ksh93.c +++ b/Src/Modules/ksh93.c @@ -171,7 +171,7 @@ ksh93_wrapper(Eprog prog, FuncWrap w, char *name) /* bindkey -v forces VIMODE so this test is as good as any */ if (curkeymapname && isset(VIMODE) && strcmp(curkeymapname, "main") == 0) - strcpy(sh_edmode, "\e"); + strcpy(sh_edmode, "\033"); else strcpy(sh_edmode, ""); if (!sh_edchar) diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index 51bb43339..e2b86e863 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -977,7 +977,7 @@ cuttext(ZLE_STRING_T line, int ct, int flags) unmetafy(mbcut, &cutll); mbcut = base64_encode(mbcut, cutll); - fprintf(shout, "\e]52;%c;%s\a", zmod.flags & MOD_CLIP ? 'c' : 'p', + fprintf(shout, "\033]52;%c;%s\a", zmod.flags & MOD_CLIP ? 'c' : 'p', mbcut); } else if (zmod.flags & MOD_VIBUF) { struct cutbuffer *b = &vibuf[zmod.vibuf];