Package: fig2dev / 1:3.2.7a-5+deb10u1

29_RGBFILE.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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.

--- a/fig2dev/colors.c
+++ b/fig2dev/colors.c
@@ -110,10 +110,15 @@ read_colordb(void)
     char		s[100], s1[100], *c1, *c2;
     unsigned short	r,g,b;
     struct color_db	*col;
+    char		*rgbfile;
 
-    fp = fopen(RGB_FILE, "r");
+    rgbfile = getenv("FIG2DEV_RGBFILE");
+    if (rgbfile == NULL) {
+      rgbfile = RGB_FILE;
+    }
+    fp = fopen(rgbfile, "r");
     if (fp == NULL) {
-      fprintf(stderr,"Couldn't open the RGB database file '%s'\n", RGB_FILE);
+      fprintf(stderr,"Couldn't open the RGB database file '%s'\n", rgbfile);
       return -1;
     }
     if ((Xcolors = (struct color_db*) malloc(maxcolors*sizeof(struct color_db)))