From 30e0160557079defa925b6d5ef4b764c3dfc8344 Mon Sep 17 00:00:00 2001 From: dobrek Date: Mon, 10 Jun 2002 16:16:20 +0000 Subject: [PATCH] - 5ce2f79e63fa49138cf7374a68f611dd fags-0.2.1.tar.gz Changed files: fags-config_dir.patch -> 1.1 --- fags-config_dir.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 fags-config_dir.patch diff --git a/fags-config_dir.patch b/fags-config_dir.patch new file mode 100644 index 0000000..aca5982 --- /dev/null +++ b/fags-config_dir.patch @@ -0,0 +1,43 @@ +diff -urN fags-0.2.1.orig/wrappers.c fags-0.2.1/wrappers.c +--- fags-0.2.1.orig/wrappers.c Sat Jun 8 12:14:16 2002 ++++ fags-0.2.1/wrappers.c Mon Jun 10 17:03:03 2002 +@@ -191,15 +191,34 @@ + { + static unsigned char file[MAX_PATH]; + unsigned char *home; ++ unsigned char *config_dir; + + home = getenv("HOME"); ++ ++ config_dir = getenv("CONFIG_DIR"); + +- if(snprintf(file, sizeof(file), "%s/.fags/%s", home?home:(unsigned char*)".", path) == -1) +- { +- NOTICE("Path too long!"); +- return NULL; +- } ++ if ( config_dir != NULL ){ ++ if (config_dir[0] == '/'){ ++ if(snprintf(file, sizeof(file), "%s/fags/%s", config_dir, path) == -1) ++ { ++ NOTICE("Path too long!"); ++ return NULL; ++ } ++ }else{ ++ if(snprintf(file, sizeof(file), "%s/%s/fags/%s", home?home:(unsigned char*)".",config_dir, path) == -1) ++ { ++ NOTICE("Path too long!"); ++ return NULL; ++ } ++ } ++ }else{ + ++ if(snprintf(file, sizeof(file), "%s/.fags/%s", home?home:(unsigned char*)".", path) == -1) ++ { ++ NOTICE("Path too long!"); ++ return NULL; ++ } ++ } + return file; + } + -- 2.43.0