1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

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 <event> is known for <np>, return a null pointer instead
  of a pointer to the empty string.
This commit is contained in:
Martijn Dekker 2021-01-08 10:18:28 +00:00
parent 54c4e94205
commit 3f15067272

View file

@ -604,7 +604,7 @@ static char *setdisc(register Namval_t* np,register const char *event,Namval_t *
action = vp->bltins[type]; action = vp->bltins[type];
vp->bltins[type] = 0; 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) static void putdisc(Namval_t* np, const char* val, int flag, Namfun_t* fp)