Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Avoid \e in C code; building on Solaris 11



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




Messages sorted by: Reverse Date, Date, Thread, Author