import changes from plan 9
This commit is contained in:
parent
a76c0fd4a9
commit
df121a0027
18 changed files with 171 additions and 167 deletions
|
|
@ -48,7 +48,7 @@ __quotesetup(char *s, Rune *r, int nin, int nout, Quoteinfo *q, int sharp, int r
|
|||
q->nbytesout = 2;
|
||||
q->nrunesout = 2;
|
||||
}
|
||||
for(; nin!=0; nin-=w){
|
||||
for(; nin!=0; nin--){
|
||||
if(s)
|
||||
w = chartorune(&c, s);
|
||||
else{
|
||||
|
|
@ -183,12 +183,14 @@ qstrfmt(char *sin, Rune *rin, Quoteinfo *q, Fmt *f)
|
|||
int
|
||||
__quotestrfmt(int runesin, Fmt *f)
|
||||
{
|
||||
int outlen;
|
||||
int nin, outlen;
|
||||
Rune *r;
|
||||
char *s;
|
||||
Quoteinfo q;
|
||||
|
||||
f->flags &= ~FmtPrec; /* ignored for %q %Q, so disable for %s %S in easy case */
|
||||
nin = -1;
|
||||
if(f->flags&FmtPrec)
|
||||
nin = f->prec;
|
||||
if(runesin){
|
||||
r = va_arg(f->args, Rune *);
|
||||
s = nil;
|
||||
|
|
@ -206,7 +208,7 @@ __quotestrfmt(int runesin, Fmt *f)
|
|||
else
|
||||
outlen = (char*)f->stop - (char*)f->to;
|
||||
|
||||
__quotesetup(s, r, -1, outlen, &q, f->flags&FmtSharp, f->runes);
|
||||
__quotesetup(s, r, nin, outlen, &q, f->flags&FmtSharp, f->runes);
|
||||
//print("bytes in %d bytes out %d runes in %d runesout %d\n", q.nbytesin, q.nbytesout, q.nrunesin, q.nrunesout);
|
||||
|
||||
if(runesin){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue