File: 29_RGBFILE.patch

package info (click to toggle)
fig2dev 1%3A3.2.9a-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,708 kB
  • sloc: ansic: 38,164; sh: 7,981; makefile: 162; csh: 12
file content (23 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.
Forwarded: Thomas Loimer <thomas.loimer@tuwien.ac.at> on Tue, 12 Jul 2016 22:14:28 +0200

--- a/fig2dev/colors.c
+++ b/fig2dev/colors.c
@@ -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);