From 3f150672720e7e31cd5b7d50fc51d334a3e7b177 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Fri, 8 Jan 2021 10:18:28 +0000 Subject: [PATCH] setdisc(): Return null pointer if no event (Solaris 110-CR7061011) This change is pulled from here: https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/110-CR7061011.patch Unfortunately there is no publicly available documentation on why this change was needed. We just have to assume the Solaris people knew what they were doing. ksh2020 upstreamed this too (as well as all the other Solaris patches applied here). src/cmd/ksh93/sh/nvdisc.c: setdisc(): - If no is known for , return a null pointer instead of a pointer to the empty string. --- src/cmd/ksh93/sh/nvdisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/sh/nvdisc.c b/src/cmd/ksh93/sh/nvdisc.c index fa6fcfcd5912..3f8015820081 100644 --- a/src/cmd/ksh93/sh/nvdisc.c +++ b/src/cmd/ksh93/sh/nvdisc.c @@ -604,7 +604,7 @@ static char *setdisc(register Namval_t* np,register const char *event,Namval_t * action = vp->bltins[type]; vp->bltins[type] = 0; } - return(action?(char*)action:""); + return((char*)action); } static void putdisc(Namval_t* np, const char* val, int flag, Namfun_t* fp)