]> git.pld-linux.org Git - packages/fags.git/commitdiff
- 5ce2f79e63fa49138cf7374a68f611dd fags-0.2.1.tar.gz
authordobrek <dobrek@pld-linux.org>
Mon, 10 Jun 2002 16:16:20 +0000 (16:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    fags-config_dir.patch -> 1.1

fags-config_dir.patch [new file with mode: 0644]

diff --git a/fags-config_dir.patch b/fags-config_dir.patch
new file mode 100644 (file)
index 0000000..aca5982
--- /dev/null
@@ -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;
+ }
This page took 0.065398 seconds and 4 git commands to generate.