zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Avoid \e in C code; building on Solaris 11
@ 2023-12-08 18:28 Oliver Kiddle
  2023-12-08 22:03 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Oliver Kiddle @ 2023-12-08 18:28 UTC (permalink / raw)
  To: Zsh workers

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];


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-10  0:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 18:28 PATCH: Avoid \e in C code; building on Solaris 11 Oliver Kiddle
2023-12-08 22:03 ` Bart Schaefer
2023-12-08 22:15   ` Bart Schaefer
2023-12-09 23:04     ` Oliver Kiddle
2023-12-10  0:29       ` Bart Schaefer
2023-12-09 22:41   ` Oliver Kiddle
2023-12-09 23:43   ` Oliver Kiddle
2023-12-10  0:33     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).