- support for HOME_ETC
[packages/irssi.git] / irssi-home_etc.patch
CommitLineData
5a521683 1diff -Nru irssi-0.8.6.orig/src/core/core.c irssi-0.8.6/src/core/core.c
2--- irssi-0.8.6.orig/src/core/core.c 2002-10-19 20:00:06.000000000 +0200
3+++ irssi-0.8.6/src/core/core.c 2003-11-09 12:46:25.000000000 +0100
4@@ -193,7 +193,9 @@
5 args_register(options);
6
7 if (irssi_dir == NULL) {
8- home = g_get_home_dir();
9+ home = getenv("HOME_ETC");
10+ if (home == NULL)
11+ home = g_get_home_dir();
12 if (home == NULL)
13 home = ".";
14
15diff -Nru irssi-0.8.6.orig/src/core/log-away.c irssi-0.8.6/src/core/log-away.c
16--- irssi-0.8.6.orig/src/core/log-away.c 2001-07-15 16:07:48.000000000 +0200
17+++ irssi-0.8.6/src/core/log-away.c 2003-11-09 12:53:24.000000000 +0100
18@@ -104,8 +104,14 @@
19 awaylog = NULL;
20 away_filepos = 0;
21 away_msgs = 0;
22-
23- settings_add_str("log", "awaylog_file", IRSSI_DIR_SHORT"/away.log");
24+ char *home_etc = getenv("HOME_ETC");
25+
26+ if (home_etc) {
27+ char *log = g_strdup_printf("%s/away.log", home_etc);
28+
29+ settings_add_str("log", "awaylog_file", log);
30+ } else
31+ settings_add_str("log", "awaylog_file", IRSSI_DIR_SHORT"/away.log");
32 settings_add_str("log", "awaylog_level", "msgs hilight");
33
34 signal_add("log written", (SIGNAL_FUNC) sig_log_written);
35diff -Nru irssi-0.8.6.orig/src/lib-popt/poptconfig.c irssi-0.8.6/src/lib-popt/poptconfig.c
36--- irssi-0.8.6.orig/src/lib-popt/poptconfig.c 2002-01-27 21:45:58.000000000 +0100
37+++ irssi-0.8.6/src/lib-popt/poptconfig.c 2003-11-09 12:36:55.000000000 +0100
38@@ -130,7 +130,9 @@
39 if (getuid() != geteuid()) return 0;
40 #endif
41
42- if ((home = getenv("HOME"))) {
43+ home = getenv("HOME_ETC");
44+ if (!home) home = getenv("HOME");
45+ if (home) {
46 fn = malloc(strlen(home) + 20);
47 strcpy(fn, home);
48 strcat(fn, "/.popt");
This page took 0.056158 seconds and 4 git commands to generate.