ordinarily, lineno must be mksh_uari_t, but edit.c most of all isn’t ready,

so we mitigate a bit (in var.c mostly) and tweak another type already, and
add some checks (mksh_{,u}ari_t must fit into {,unsigned }long) and print
line numbers with %lu already
This commit is contained in:
tg
2015-04-19 18:50:38 +00:00
parent a2a4e41975
commit 65f9b93926
6 changed files with 22 additions and 19 deletions

View File

@@ -27,7 +27,7 @@
#include <sys/file.h>
#endif
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.140 2015/03/07 20:46:28 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.141 2015/04/19 18:50:36 tg Exp $");
Trap sigtraps[NSIG + 1];
static struct sigaction Sigact_ign;
@@ -275,8 +275,9 @@ c_fc(const char **wp)
for (hp = rflag ? hlast : hfirst;
hp >= hfirst && hp <= hlast; hp += rflag ? -1 : 1) {
if (!nflag)
shf_fprintf(shl_stdout, "%d",
hist_source->line - (int)(histptr - hp));
shf_fprintf(shl_stdout, "%lu",
(unsigned long)hist_source->line -
(unsigned long)(histptr - hp));
shf_putc('\t', shl_stdout);
/* print multi-line commands correctly */
s = *hp;