gbranden pushed a commit to branch master
in repository groff.
commit f6abf63afc31c47ab0565543faf109360175ba70
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 21 13:16:39 2021 +1000
[libgroff]: Treat empty GROFF_TYPESETTER as unset.
* src/libs/libgroff/device.cpp (device_init::device_init): Test both
returned pointer from `getenv()` and, if that's not null, the first
character of the string for nullity before assigning it to `device`.
Fixes <https://savannah.gnu.org/bugs/?61068>.
---
ChangeLog | 11 +++++++++++
src/libs/libgroff/device.cpp | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 318e994..23b8d6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2021-08-21 G. Branden Robinson <[email protected]>
+ [libgroff]: Treat an empty $GROFF_TYPESETTER as unset.
+
+ * src/libs/libgroff/device.cpp (device_init::device_init): Test
+ both returned pointer from `getenv()` and, if that's not null,
+ the first character of the string for nullity before assigning
+ it to `device`.
+
+ Fixes <https://savannah.gnu.org/bugs/?61068>.
+
+2021-08-21 G. Branden Robinson <[email protected]>
+
Update .version file more aggressively.
* Makefile.am: Regenerate a temporary version string file on
diff --git a/src/libs/libgroff/device.cpp b/src/libs/libgroff/device.cpp
index 33ffdca..6caeb8e 100644
--- a/src/libs/libgroff/device.cpp
+++ b/src/libs/libgroff/device.cpp
@@ -34,6 +34,6 @@ struct device_init {
device_init::device_init()
{
char *tem = getenv("GROFF_TYPESETTER");
- if (tem)
+ if (tem && tem[0])
device = tem;
}
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit