Skip to content

Commit

Permalink
Use correct filename for audit file
Browse files Browse the repository at this point in the history
`AUDIT_FILE` contains name of the file that should be used as audit
file. Use it's value instead of stringifying it. Also, remove unused
macro `stringify`.

Related: #240
  • Loading branch information
siteshwar committed Nov 27, 2018
1 parent c530b43 commit 1fcd9ac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cmd/ksh93/edit/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
#include "stk.h"
#include "tv.h"

#define stringify(s) #s

//
// Each command in the history file starts on an even byte is null terminated. The first byte must
// contain the special character HIST_UNDO and the second byte is the version number. The sequence
Expand Down Expand Up @@ -281,7 +279,7 @@ int sh_histinit(void *sh_context) {

char buff[SF_BUFSIZE];
if (!sh_isstate(shp, SH_INTERACTIVE)) return 1;
hp->auditmask = sh_checkaudit(hp, stringify(AUDIT_FILE), buff, sizeof(buff));
hp->auditmask = sh_checkaudit(hp, AUDIT_FILE, buff, sizeof(buff));
if (!hp->auditmask) return 1;

if ((fd = sh_open(buff, O_BINARY | O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC,
Expand Down

0 comments on commit 1fcd9ac

Please sign in to comment.