slightly optimised and, more importantly, much more consistent (use only

one set of CTRL, UNCTRL, and new ISCTRL macros) C0 and DEL handling; the
optimisation only works for 7-bit ASCII, so those places 8-bit must pass
intact have an added check

also, while here, remove an editor oops (‘;’), oksh rcsid sync (they did
accept I was right wrt. set -e), int → bool, and code merge/cleanup
This commit is contained in:
tg
2013-09-24 20:19:45 +00:00
parent 2e7509548a
commit 7f16464902
6 changed files with 68 additions and 76 deletions

View File

@@ -27,7 +27,7 @@
#include <sys/file.h>
#endif
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.131 2012/12/28 02:28:35 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.132 2013/09/24 20:19:44 tg Exp $");
Trap sigtraps[NSIG + 1];
static struct sigaction Sigact_ign;
@@ -442,7 +442,7 @@ hist_get(const char *str, bool approx, bool allow_cur)
hp = NULL;
}
} else {
int anchored = *str == '?' ? (++str, 0) : 1;
bool anchored = *str == '?' ? (++str, false) : true;
/* the -1 is to avoid the current fc command */
if ((n = findhist(histptr - history - 1, 0, str, anchored)) < 0)
@@ -509,7 +509,7 @@ histnum(int n)
* direction.
*/
int
findhist(int start, int fwd, const char *str, int anchored)
findhist(int start, int fwd, const char *str, bool anchored)
{
char **hp;
int maxhist = histptr - history;