[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 12/15: [libgroff]: Drop line # from some diagnostics.
From: |
G. Branden Robinson |
Subject: |
[groff] 12/15: [libgroff]: Drop line # from some diagnostics. |
Date: |
Fri, 17 Sep 2021 05:34:39 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit c5772157d1136372470f5d75d37194658493e045
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Sep 17 16:29:43 2021 +1000
[libgroff]: Drop line # from some diagnostics.
* src/libs/libgroff/font.cpp (font::load_desc): Clear line number before
emitting whole-file validity diagnostics.
$ nl build/font/devutf8/DESC
1 #res 240
2 hor 24
3 vert 40
4 unitwidth 10
5 sizes 10 0
6 fonts 4 R I B BI
7 tcommand
8 postpro grotty
9 unicode
$ GROFF_FONT_PATH=build/font groff -Tutf8
groff:build/font/devutf8/DESC:9: missing 'res' command
groff: fatal error: invalid device 'utf8'
$ build/test-groff -Tutf8
.../build/groff:.../build/font/devutf8/DESC: error: device description file
missing 'res' directive
.../build/groff: fatal error: cannot load 'DESC' description file for
device 'utf8'
---
ChangeLog | 5 +++++
src/libs/libgroff/font.cpp | 1 +
2 files changed, 6 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 1732526..b49fbb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2021-09-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * src/libs/libgroff/font.cpp (font::load_desc): Clear line
+ number before emitting whole-file validity diagnostics.
+
+2021-09-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* src/libs/libgroff/font.cpp (font::load_desc): Emit correct
line numbers when complaining of invalid `sizescale`, `hor`, or
`vert` values in device description files.
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 6baa85b..99aa640 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -1238,6 +1238,7 @@ bool font::load_desc()
t.lineno);
}
}
+ t.lineno = 0;
if (res == 0) {
t.error("device description file missing 'res' directive");
return false;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 12/15: [libgroff]: Drop line # from some diagnostics.,
G. Branden Robinson <=