From: juandon Date: Sat, 29 Mar 2003 18:42:29 +0000 (+0000) Subject: - CONFIG_DIR support X-Git-Tag: AC-STABLE~5 X-Git-Url: http://git.pld-linux.org/?p=packages%2Ffmio.git;a=commitdiff_plain;h=0197389d34a69af37abe68a79887dc9ba0c78355 - CONFIG_DIR support Changed files: fmio-home_etc.patch -> 1.1 --- diff --git a/fmio-home_etc.patch b/fmio-home_etc.patch new file mode 100644 index 0000000..3a688b3 --- /dev/null +++ b/fmio-home_etc.patch @@ -0,0 +1,52 @@ +diff -Nru fmio-1.2.29/xsrc/wmfmio.c fmio-1.2.29.new/xsrc/wmfmio.c +--- fmio-1.2.29/xsrc/wmfmio.c Fri Jul 5 17:29:20 2002 ++++ fmio-1.2.29.new/xsrc/wmfmio.c Sat Mar 29 12:21:20 2003 +@@ -148,25 +148,37 @@ + int + main(int argc,char *argv[]) { + char *home; ++ char *config_dir; ++ + myname = argv[0]; + ParseCMDLine(argc, argv); +- +- home = getenv("HOME"); +- if (home == NULL) +- home = "."; +- strncpy(temp, home, TMPBUFSIZE); +- temp[TMPBUFSIZE] = '\0'; +- strncat(temp, "/.", TMPBUFSIZE); +- temp[TMPBUFSIZE] = '\0'; +- strncat(temp, RCFILE, TMPBUFSIZE); +- temp[TMPBUFSIZE] = '\0'; ++ ++ config_dir = getenv("CONFIG_DIR"); ++ if (config_dir) { ++ strncpy(temp, config_dir, TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ strncat(temp, "/", TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ strncat(temp, RCFILE, TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ } else { ++ home = getenv("HOME"); ++ if (home == NULL) ++ home = "."; ++ strncpy(temp, home, TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ strncat(temp, "/.", TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ strncat(temp, RCFILE, TMPBUFSIZE); ++ temp[TMPBUFSIZE] = '\0'; ++ } + if ( ParseRCFile(temp) == 1 ) { + strncpy(temp, "/etc/", TMPBUFSIZE); + temp[TMPBUFSIZE] = '\0'; + strncat(temp, RCFILE, TMPBUFSIZE); + temp[TMPBUFSIZE] = '\0'; + if (ParseRCFile(temp) == 1) +- errx(1, "~/.%s or /etc/%s not found", RCFILE, RCFILE); ++ errx(1, "$CONFIG_DIR/%s, ~/.%s or /etc/%s not found", RCFILE, RCFILE, RCFILE); + } + + if (cmdline_preset == ON)