File fig2dev-3.2.6a-RGBFILE.patch of Package transfig

From: Roland Rosenfeld <roland@debian.org>
Subject: rgb.txt can not be located via FIG2DEV_RGBFILE environment variable.
 This allows one to run the test suite without the package being
 installed before.

---
 fig2dev/colors.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/fig2dev/colors.c
+++ b/fig2dev/colors.c	2019-10-29 11:03:32.206632962 +0000
@@ -730,8 +730,13 @@ read_colordb(void)
 	FILE		*fp;
 #define MAX_LINE	100
 	char		s[MAX_LINE], s1[MAX_LINE];
+	char		*rgbfile;
 
-	fp = fopen(RGB_FILE, "r");
+	rgbfile = getenv("FIG2DEV_RGBFILE");
+	if (rgbfile == NULL) {
+		rgbfile = RGB_FILE;
+	}
+	fp = fopen(rgbfile, "r");
 	if (fp == NULL) {
 		Xcolors = defaultXcolors;
 		numXcolors = sizeof(defaultXcolors) / sizeof(struct color_db);
openSUSE Build Service is sponsored by