]> git.pld-linux.org Git - packages/bogofilter.git/commitdiff
- support for HOME_ETC
authorwitekfl <witekfl@pld-linux.org>
Thu, 13 Nov 2003 06:06:07 +0000 (06:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bogofilter-home_etc.patch -> 1.1

bogofilter-home_etc.patch [new file with mode: 0644]

diff --git a/bogofilter-home_etc.patch b/bogofilter-home_etc.patch
new file mode 100644 (file)
index 0000000..78f1949
--- /dev/null
@@ -0,0 +1,38 @@
+diff -Nru bogofilter-0.15.8.orig/src/configfile.c bogofilter-0.15.8/src/configfile.c
+--- bogofilter-0.15.8.orig/src/configfile.c    2003-10-06 00:01:40.000000000 +0200
++++ bogofilter-0.15.8/src/configfile.c 2003-11-12 18:12:59.000000000 +0100
+@@ -195,8 +195,14 @@
+     FILE *fp;
+     char *filename;
+     char *arg = NULL, *val = NULL;
++    char *home_etc = getenv("HOME_ETC");              
+-    filename = tildeexpand(fname, tilde_expand);
++    if (home_etc && fname[0] == '~') {
++      char buffer[1024];
++      
++      snprintf(buffer, 1024, "%s%s", home_etc, fname + 1);
++      filename = xstrdup(buffer);
++    } else filename = tildeexpand(fname, tilde_expand);
+     fp = fopen(filename, "r");
+--- bogofilter-0.15.8.orig/src/paths.c 2003-09-30 00:31:20.000000000 +0200
++++ bogofilter-0.15.8/src/paths.c      2003-11-12 18:27:10.000000000 +0100
+@@ -29,7 +29,7 @@
+ #ifndef __riscos__
+     { PR_ENV_BOGO, "BOGOFILTER_DIR", NULL },
+     { PR_ENV_BOGO, "BOGODIR",      NULL },
+-    { PR_ENV_HOME, "HOME",         BOGODIR }
++    { PR_ENV_HOME, "HOME_ETC",             BOGODIR }
+ #else
+     { PR_ENV_HOME, "Choices$Write",  BOGODIR },
+     { PR_ENV_HOME, "Bogofilter$Dir", NULL },
+@@ -91,6 +91,7 @@
+     size_t path_size, env_size;
+     env = getenv(var);
++    if (env == NULL && strcmp(var, "HOME_ETC") == 0) env = getenv("HOME"); 
+     if (env == NULL || strlen(env) == 0) return NULL;
+     env_size = strlen(env);
This page took 0.098268 seconds and 4 git commands to generate.