diff --git a/NEWS b/NEWS index d55fd75fa..fe6b22f7e 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh Any uppercase BUG_* names are modernish shell bug IDs. +2020-07-06: + +- 'notty' is now written to the ksh auditing file instead of '(null)' if + the user's tty could not be determined. + 2020-07-05: - In UTF-8 locales, fix corruption of the shell's internal string quoting diff --git a/src/cmd/ksh93/edit/history.c b/src/cmd/ksh93/edit/history.c index d6737e209..f40f27b4a 100644 --- a/src/cmd/ksh93/edit/history.c +++ b/src/cmd/ksh93/edit/history.c @@ -395,7 +395,7 @@ retry: if(fd>=0) { fcntl(fd,F_SETFD,FD_CLOEXEC); - hp->tty = strdup(ttyname(2)); + hp->tty = strdup(isatty(2)?ttyname(2):"notty"); hp->auditfp = sfnew((Sfio_t*)0,NULL,-1,fd,SF_WRITE); } } diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index 2ee19b9b1..575941029 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -17,4 +17,4 @@ * David Korn * * * ***********************************************************************/ -#define SH_RELEASE "93u+m 2020-07-05" +#define SH_RELEASE "93u+m 2020-07-06"