Skip to content

Commit

Permalink
setdisc(): Return null pointer if no event (Solaris 110-CR7061011)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
McDutchie committed Jan 8, 2021
1 parent 54c4e94 commit 3f15067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/nvdisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f15067

Please sign in to comment.