]>
Commit | Line | Data |
---|---|---|
30e01605 | 1 | diff -urN fags-0.2.1.orig/wrappers.c fags-0.2.1/wrappers.c |
2 | --- fags-0.2.1.orig/wrappers.c Sat Jun 8 12:14:16 2002 | |
3 | +++ fags-0.2.1/wrappers.c Mon Jun 10 17:03:03 2002 | |
4 | @@ -191,15 +191,34 @@ | |
5 | { | |
6 | static unsigned char file[MAX_PATH]; | |
7 | unsigned char *home; | |
8 | + unsigned char *config_dir; | |
9 | ||
10 | home = getenv("HOME"); | |
11 | + | |
12 | + config_dir = getenv("CONFIG_DIR"); | |
13 | ||
14 | - if(snprintf(file, sizeof(file), "%s/.fags/%s", home?home:(unsigned char*)".", path) == -1) | |
15 | - { | |
16 | - NOTICE("Path too long!"); | |
17 | - return NULL; | |
18 | - } | |
19 | + if ( config_dir != NULL ){ | |
20 | + if (config_dir[0] == '/'){ | |
21 | + if(snprintf(file, sizeof(file), "%s/fags/%s", config_dir, path) == -1) | |
22 | + { | |
23 | + NOTICE("Path too long!"); | |
24 | + return NULL; | |
25 | + } | |
26 | + }else{ | |
27 | + if(snprintf(file, sizeof(file), "%s/%s/fags/%s", home?home:(unsigned char*)".",config_dir, path) == -1) | |
28 | + { | |
29 | + NOTICE("Path too long!"); | |
30 | + return NULL; | |
31 | + } | |
32 | + } | |
33 | + }else{ | |
34 | ||
35 | + if(snprintf(file, sizeof(file), "%s/.fags/%s", home?home:(unsigned char*)".", path) == -1) | |
36 | + { | |
37 | + NOTICE("Path too long!"); | |
38 | + return NULL; | |
39 | + } | |
40 | + } | |
41 | return file; | |
42 | } | |
43 |