This call was added along with the magic check, but it not actually needed: history_load already calls rewind(3). I feel like the magic check should also be in history_load(), so that a ksh process can recover at runtime from a binary->plaintext history file migration. Worth the trouble?
ok for the diff below? Index: history.c =================================================================== RCS file: /d/cvs/src/bin/ksh/history.c,v retrieving revision 1.72 diff -u -p -p -u -r1.72 history.c --- history.c 18 Oct 2017 15:41:25 -0000 1.72 +++ history.c 18 Oct 2017 22:25:23 -0000 @@ -799,8 +799,6 @@ hist_init(Source *s) return; } - rewind(histfh); - history_load(s); history_lock(LOCK_UN); -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE