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:
8
lex.c
8
lex.c
@@ -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);
|
||||
|
Reference in New Issue
Block a user