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

8
lex.c
View File

@@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.199 2015/04/11 22:03:30 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.200 2015/04/19 18:50:36 tg Exp $");
/*
* states while lexing word
@@ -1480,7 +1480,7 @@ getsc_line(Source *s)
void
set_prompt(int to, Source *s)
{
cur_prompt = to;
cur_prompt = (uint8_t)to;
switch (to) {
/* command */
@@ -1503,8 +1503,8 @@ set_prompt(int to, Source *s)
if (*ps1 != '!' || *++ps1 == '!')
shf_putchar(*ps1++, shf);
else
shf_fprintf(shf, "%d",
s ? s->line + 1 : 0);
shf_fprintf(shf, "%lu", s ?
(unsigned long)s->line + 1 : 0UL);
ps1 = shf_sclose(shf);
saved_atemp = ATEMP;
newenv(E_ERRH);