summaryrefslogtreecommitdiffstats
path: root/src/lib9/fmt/fmtquote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/fmt/fmtquote.c')
-rw-r--r--src/lib9/fmt/fmtquote.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib9/fmt/fmtquote.c b/src/lib9/fmt/fmtquote.c
index 5b8f9fd4..8c8daaee 100644
--- a/src/lib9/fmt/fmtquote.c
+++ b/src/lib9/fmt/fmtquote.c
@@ -91,6 +91,11 @@ __quotesetup(char *s, Rune *r, int nin, int nout, Quoteinfo *q, int sharp, int r
/* advance output */
q->nbytesout += w;
q->nrunesout++;
+
+#ifndef PLAN9PORT
+ /* ANSI requires precision in bytes, not Runes. */
+ nin-= w-1; /* and then n-- in the loop */
+#endif
}
}