upas/ned: fix %.*s format in parsesearch(), improve mkfile

front
cinap_lenrek 2019-02-25 03:34:25 +01:00
parent 536805bce3
commit 2e5cd278d7
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,4 @@
</$objtype/mkfile </$objtype/mkfile
<../mkupas
TARG=nedmail TARG=nedmail
@ -17,3 +16,4 @@ UPDATE=\
</sys/src/cmd/mkone </sys/src/cmd/mkone
CFLAGS=$CFLAGS -I../common CFLAGS=$CFLAGS -I../common
<../mkupas

View File

@ -1074,7 +1074,7 @@ parsesearch(char **pp, char *buf, int bufl)
np = qstrchr(p, c); np = qstrchr(p, c);
if(c == '#' && np) if(c == '#' && np)
if(e = qstrchr(np + 1, c)){ if(e = qstrchr(np + 1, c)){
snprint(buf, bufl, "%.*s", (int)(np - p), p); snprint(buf, bufl, "%.*s", utfnlen(p, np - p), p);
p = np + 1; p = np + 1;
np = e; np = e;
} }