From: juandon Date: Mon, 7 Apr 2003 12:21:34 +0000 (+0000) Subject: - s/CONFIG_DIR/ETC_DIR/ X-Git-Url: http://git.pld-linux.org/gitweb.cgi?p=packages%2Falthea.git;a=commitdiff_plain;h=587244beac67d6c78dfe7c823cd42f0fd58ddd4b - s/CONFIG_DIR/ETC_DIR/ - s/home_etc/etc_dir/ Changed files: althea-etc_dir.patch -> 1.1 --- diff --git a/althea-etc_dir.patch b/althea-etc_dir.patch new file mode 100644 index 0000000..4c3b65c --- /dev/null +++ b/althea-etc_dir.patch @@ -0,0 +1,95 @@ +diff -Nru althea-0.5.7/load_config.cpp althea-0.5.7.new/load_config.cpp +--- althea-0.5.7/load_config.cpp Tue Jan 22 17:30:15 2002 ++++ althea-0.5.7.new/load_config.cpp Sat Mar 22 20:30:52 2003 +@@ -22,14 +22,28 @@ + + bool savepassword=1, usessl=0, usesmtps=0; + +- // Get the environment variable HOME, this is POSIX and Windows Compliant +- home_directory=(char *)malloc(255); +- strcpy(home_directory,getenv ("HOME")); +- strcat(home_directory, "/"); +- strcat(home_directory, LOCAL_CONFIG_FILE); ++ char *etc_dir = getenv("ETC_DIR"); ++ if (etc_dir) ++ { ++ home_directory=(char *)malloc(255); ++ strcpy(home_directory,etc_dir); ++ strcat(home_directory, "/"); ++ strcat(home_directory, ETC_DIR_CONFIG_FILE); + +- local_config_in.open(home_directory); +- free(home_directory); ++ local_config_in.open(home_directory); ++ free(home_directory); ++ } ++ else ++ { ++ // Get the environment variable HOME, this is POSIX and Windows Compliant ++ home_directory=(char *)malloc(255); ++ strcpy(home_directory,getenv ("HOME")); ++ strcat(home_directory, "/"); ++ strcat(home_directory, LOCAL_CONFIG_FILE); ++ ++ local_config_in.open(home_directory); ++ free(home_directory); ++ } + rc_config_in.open(RC_CONFIG_FILE); + + +diff -Nru althea-0.5.7/load_config.h althea-0.5.7.new/load_config.h +--- althea-0.5.7/load_config.h Tue Jan 22 17:30:15 2002 ++++ althea-0.5.7.new/load_config.h Sat Mar 22 20:28:33 2003 +@@ -20,6 +20,7 @@ + #include "promptwindow.h" + + #define LOCAL_CONFIG_FILE ".althearc" ++#define ETC_DIR_CONFIG_FILE "althearc" + #define RC_CONFIG_FILE "/etc/althearc" + + extern Althea gAlthea; +diff -Nru althea-0.5.7/save_config.cpp althea-0.5.7.new/save_config.cpp +--- althea-0.5.7/save_config.cpp Tue Jan 22 17:30:15 2002 ++++ althea-0.5.7.new/save_config.cpp Sat Mar 22 20:33:17 2003 +@@ -16,12 +16,24 @@ + char* file_name; + Configuration *config; + +- // Get the environment variable HOME, this is POSIX and Windows Compliant +- file_name=(char *)malloc (255); +- strcpy(file_name, getenv ("HOME")); +- strcat(file_name, "/"); +- strcat(file_name,LOCAL_CONFIG_FILE); +- config_file.open(file_name); ++ char *etc_dir = getenv("ETC_DIR"); ++ if (etc_dir) ++ { ++ file_name=(char *)malloc (255); ++ strcpy(file_name, etc_dir); ++ strcat(file_name, "/"); ++ strcat(file_name,ETC_DIR_CONFIG_FILE); ++ config_file.open(file_name); ++ } ++ else ++ { ++ // Get the environment variable HOME, this is POSIX and Windows Compliant ++ file_name=(char *)malloc (255); ++ strcpy(file_name, getenv ("HOME")); ++ strcat(file_name, "/"); ++ strcat(file_name,LOCAL_CONFIG_FILE); ++ config_file.open(file_name); ++ } + if (gAlthea.get_Verbose()) + cout << "Saveing to " << file_name << endl; + +diff -Nru althea-0.5.7/save_config.h althea-0.5.7.new/save_config.h +--- althea-0.5.7/save_config.h Tue Jan 22 17:30:15 2002 ++++ althea-0.5.7.new/save_config.h Sat Mar 22 20:31:26 2003 +@@ -17,6 +17,7 @@ + #include "crypto.h" + + #define LOCAL_CONFIG_FILE ".althearc" ++#define ETC_DIR_CONFIG_FILE "althearc" + #define RC_CONFIG_FILE "/etc/althearc" + + // The master function that saves the config in memory to disk