2017-11-22 13:37:26 +01:00
|
|
|
From: Roland Rosenfeld <roland@debian.org>
|
|
|
|
Subject: rgb.txt can not be located via FIG2DEV_RGBFILE environment variable.
|
2018-05-07 12:32:51 +02:00
|
|
|
This allows one to run the test suite without the package being
|
|
|
|
installed before.
|
2017-11-22 13:37:26 +01:00
|
|
|
|
2019-10-29 12:12:25 +01:00
|
|
|
---
|
|
|
|
fig2dev/colors.c | 7 ++++++-
|
|
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
|
2017-11-22 13:37:26 +01:00
|
|
|
--- a/fig2dev/colors.c
|
2019-10-29 12:12:25 +01:00
|
|
|
+++ b/fig2dev/colors.c 2019-10-29 11:03:32.206632962 +0000
|
2021-02-12 11:22:10 +01:00
|
|
|
@@ -730,8 +730,13 @@ read_colordb(void)
|
2019-10-29 12:12:25 +01:00
|
|
|
FILE *fp;
|
|
|
|
#define MAX_LINE 100
|
|
|
|
char s[MAX_LINE], s1[MAX_LINE];
|
|
|
|
+ char *rgbfile;
|
2017-11-22 13:37:26 +01:00
|
|
|
|
2019-10-29 12:12:25 +01:00
|
|
|
- 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);
|