diff --git a/edit.c b/edit.c index b079daf..c391c43 100644 --- a/edit.c +++ b/edit.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.132 2008/09/30 17:23:00 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.133 2008/09/30 17:49:24 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -3155,7 +3155,7 @@ x_edit_line(int c __unused) if (modified) { *xep = '\0'; source->line++; - histsave(source->line, xbuf, 1); + histsave(source->line, xbuf, true); x_arg = 0; } else x_arg = source->line - (histptr - x_histp); @@ -4366,7 +4366,7 @@ vi_cmd(int argcnt, const char *cmd) if (modified) { es->cbuf[es->linelen] = '\0'; source->line++; - histsave(source->line, es->cbuf, 1); + histsave(source->line, es->cbuf, true); } else argcnt = source->line + 1 - (hlast - hnum); diff --git a/funcs.c b/funcs.c index cb64211..bf22090 100644 --- a/funcs.c +++ b/funcs.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.87 2008/09/17 19:31:29 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.88 2008/09/30 17:49:25 tg Exp $"); /* A leading = means assignments before command are kept; * a leading * means a POSIX special builtin; @@ -503,7 +503,7 @@ c_print(const char **wp) if (flags & PO_HIST) { Xput(xs, xp, '\0'); source->line++; - histsave(source->line, Xstring(xs, xp), 1); + histsave(source->line, Xstring(xs, xp), true); Xfree(xs, xp); } else { int n, len = Xlength(xs, xp); @@ -1895,7 +1895,7 @@ c_read(const char **wp) if (historyr) { Xput(xs, xp, '\0'); source->line++; - histsave(source->line, Xstring(xs, xp), 1); + histsave(source->line, Xstring(xs, xp), true); Xfree(xs, xp); } /* if this is the co-process fd, close the file descriptor diff --git a/histrap.c b/histrap.c index d79c84a..ab10332 100644 --- a/histrap.c +++ b/histrap.c @@ -3,7 +3,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.67 2008/07/12 17:16:03 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.68 2008/09/30 17:49:26 tg Exp $"); /*- * MirOS: This is the default mapping type, and need not be specified. @@ -280,7 +280,7 @@ hist_execute(char *cmd) if (!*q) /* ignore trailing newline */ q = NULL; } - histsave(++(hist_source->line), p, 1); + histsave(++(hist_source->line), p, true); shellf("%s\n", p); /* POSIX doesn't say this is done... */ if ((p = q)) /* restore \n (trailing \n not restored) */ @@ -574,7 +574,7 @@ init_histvec(void) * save command in history */ void -histsave(int lno __unused, const char *cmd, int dowrite __unused) +histsave(int lno __unused, const char *cmd, bool dowrite __unused) { char **hp; char *c, *cp; @@ -858,7 +858,7 @@ histload(Source *s, unsigned char *base, int bytes) histinsert(s, lno, (char *)line); } else { s->line = lno; - histsave(lno, (char *)line, 0); + histsave(lno, (char *)line, false); } state = shdr; } diff --git a/lex.c b/lex.c index ae1cdb1..d3ee266 100644 --- a/lex.c +++ b/lex.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.67 2008/09/20 14:17:30 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.68 2008/09/30 17:49:26 tg Exp $"); /* * states while lexing word @@ -1243,7 +1243,7 @@ getsc_line(Source *s) char *p = Xstring(s->xs, xp); if (*p && (cur_prompt != PS1 || !ctype(*p, C_IFS | C_IFSWS))) { s->line++; - histsave(s->line, s->str, 1); + histsave(s->line, s->str, true); } } if (interactive) diff --git a/sh.h b/sh.h index ff01d45..9111cf6 100644 --- a/sh.h +++ b/sh.h @@ -100,7 +100,7 @@ #define __SCCSID(x) __IDSTRING(sccsid,x) #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.233 2008/09/20 19:18:00 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.234 2008/09/30 17:49:26 tg Exp $"); #endif #define MKSH_VERSION "R35 2008/09/20" @@ -1306,7 +1306,7 @@ void hist_init(Source *); #if HAVE_PERSISTENT_HISTORY void hist_finish(void); #endif -void histsave(int, const char *, int); +void histsave(int, const char *, bool); int c_fc(const char **); void sethistsize(int); #if HAVE_PERSISTENT_HISTORY