[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 04/16: [libgroff]: Treat empty GROFF_TYPESETTER as unset.
From: |
G. Branden Robinson |
Subject: |
[groff] 04/16: [libgroff]: Treat empty GROFF_TYPESETTER as unset. |
Date: |
Mon, 23 Aug 2021 00:06:39 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit f6abf63afc31c47ab0565543faf109360175ba70
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
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 <g.branden.robinson@gmail.com>
+ [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 <g.branden.robinson@gmail.com>
+
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;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 04/16: [libgroff]: Treat empty GROFF_TYPESETTER as unset.,
G. Branden Robinson <=