summaryrefslogtreecommitdiff
path: root/chat/eggdrop/patches/patch-ab
blob: 2b1451b8d8ca1958cd69508ad981d627f5cf715e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$NetBSD: patch-ab,v 1.3 2003/05/24 16:43:05 salo Exp $

--- src/main.c.orig	2003-05-04 22:15:53.000000000 +0200
+++ src/main.c	2003-05-24 16:56:20.000000000 +0200
@@ -70,7 +70,7 @@
 #define _POSIX_SOURCE 1
 #endif
 
-extern char origbotname[], userfile[], botnetnick[];
+extern char origbotname[], userfile[], botnetnick[], tempdir[];
 extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs;
 extern struct dcc_t *dcc;
 extern struct userrec *userlist;
@@ -101,7 +101,7 @@
                                  * stats? */
 int term_z = 0;                 /* Foreground: use the terminal as a party
                                  * line? */
-char configfile[121] = "eggdrop.conf";  /* Name of the config file */
+char configfile[121] = __PKG_SYSCONFDIR__ "eggdrop.conf";  /* Name of the config file */
 char helpdir[121] = "help/";    /* Directory of help files (if used) */
 char textdir[121] = "text/";    /* Directory for text files that get dumped */
 int keep_all_logs = 0;          /* Never erase logfiles, no matter how old
@@ -735,6 +735,8 @@
   }
 #endif
 
+  chdir(__PREFIX__ "/share/eggdrop");
+
   /* Initialise context list */
   for (i = 0; i < 16; i++)
     Context;
@@ -834,7 +836,8 @@
   cache_miss = 0;
   cache_hit = 0;
   if (!pid_file[0])
-    egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick);
+    egg_snprintf(pid_file, sizeof pid_file, "%.100s/pid.%.32s",
+                 tempdir, botnetnick);
 
   /* Check for pre-existing eggdrop! */
   f = fopen(pid_file, "r");