schwarze pushed a commit to branch master
in repository groff.
commit b1b17c68ca0560106372908db4395fd8f96f5268
Author: Ingo Schwarze <[email protected]>
Date: Fri Dec 27 21:09:24 2019 +0100
Correct output of sprintf("%%") in pic(1).
* src/preproc/pic/pic.ypp: Print "%" rather than "%%".
Bug reported by Doug McIlroy <doug at cs dot dartmouth dot edu>.
Patch using feedback from Larry McVoy <lm at mcvoy dot com>.
OK Colin Watson and Larry McVoy.
---
ChangeLog | 9 +++++++++
src/preproc/pic/pic.ypp | 6 ++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e5c11e1..baead25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-12-30 Ingo Schwarze <[email protected]>
+
+ Correct output of sprintf("%%") in pic(1).
+
+ * src/preproc/pic/pic.ypp: Print "%" rather than "%%".
+
+ Bug reported by Doug McIlroy <doug at cs dot dartmouth dot edu>.
+ Patch using feedback from Larry McVoy <lm at mcvoy dot com>.
+
2019-12-29 Deri James <[email protected]>
Update man page of gropdf to document \X calls.
diff --git a/src/preproc/pic/pic.ypp b/src/preproc/pic/pic.ypp
index 6afa2ab..92d2bb1 100644
--- a/src/preproc/pic/pic.ypp
+++ b/src/preproc/pic/pic.ypp
@@ -1905,10 +1905,8 @@ char *do_sprintf(const char *form, const double *v, int
nv)
break;
}
if (*form == '%') {
- one_format += *form++;
- one_format += '\0';
- snprintf(sprintf_buf, sizeof(sprintf_buf),
- "%s", one_format.contents());
+ form++;
+ snprintf(sprintf_buf, sizeof(sprintf_buf), "%%");
}
else {
if (i >= nv) {
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit