summaryrefslogtreecommitdiff
path: root/chat/ickle/patches/patch-ab
blob: 8d2072a12550fd05856f8beaff36a208d4850cff (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
$NetBSD: patch-ab,v 1.1.1.1 2003/04/30 00:00:19 hubertf Exp $
--- ickle/IckleClient.cpp.orig	Fri Apr 11 22:32:26 2003
+++ ickle/IckleClient.cpp	Fri Apr 11 22:34:32 2003
@@ -162,7 +162,7 @@
 
 void IckleClient::loadContactList() {
   Dir dir;
-  dir.list( CONTACT_DIR + "*.user" );
+  dir.list( CONTACT_DIR + "/*.user" );
 
   Dir::iterator dirit = dir.begin();
   while( dirit != dir.end() ) {
@@ -190,7 +190,7 @@
       exit(0);
       break;
     case 'b': // base dir
-      BASE_DIR = string(optarg) + "/";
+      BASE_DIR = string(optarg);
       break;
     }
   }
@@ -201,18 +201,18 @@
     if (dir == NULL) dir = getenv("PWD");
 
     if (dir != NULL) {
-      BASE_DIR = string(dir) + "/.ickle/";
+      BASE_DIR = string(dir) + "/.ickle";
     } else {
-      BASE_DIR = ".ickle/";
+      BASE_DIR = ".ickle";
     }
     
   }
 
-  CONTACT_DIR = BASE_DIR + "contacts/";
-  DATA_DIR = string(PKGDATADIR) + "/";
-  TRANSLATIONS_DIR = DATA_DIR + "translations/";
-  ICONS_DIR = DATA_DIR + "icons/";
-  PID_FILENAME = BASE_DIR + "ickle.pid";
+  CONTACT_DIR = BASE_DIR + "/contacts";
+  DATA_DIR = string(PKGDATADIR);
+  TRANSLATIONS_DIR = DATA_DIR + "/translations";
+  ICONS_DIR = DATA_DIR + "/icons";
+  PID_FILENAME = BASE_DIR + "/ickle.pid";
 }
 
 void IckleClient::usageInstructions(const char* progname) {
@@ -232,10 +232,10 @@
 void IckleClient::loadSettings() {
   // load in settings
   try {
-    g_settings.load(BASE_DIR + "ickle.conf");
+    g_settings.load(BASE_DIR + "/ickle.conf");
   } catch (runtime_error& e) {
     ostringstream ostr;
-    ostr << "Couldn't open " << BASE_DIR << "ickle.conf, using default settings" << endl
+    ostr << "Couldn't open " << BASE_DIR << "/ickle.conf, using default settings" << endl
 	 << "This is probably the first time you've run ickle.";
     SignalLog(ICQ2000::LogEvent::WARN, ostr.str());
   }
@@ -401,7 +401,7 @@
 
   if (!mkdir_BASE_DIR()) return;
   
-  string ickle_conf = BASE_DIR + "ickle.conf";
+  string ickle_conf = BASE_DIR + "/ickle.conf";
 
   // set umask to secure value, so that if ickle.conf doesn't exist, and is created it will be safe.
   mode_t old_umask = umask(0077);
@@ -410,7 +410,7 @@
     g_settings.save(ickle_conf);
   } catch(runtime_error& e) {
     ostringstream ostr;
-    ostr << "Couldn't save " << BASE_DIR << "ickle.conf";
+    ostr << "Couldn't save " << BASE_DIR << "/ickle.conf";
     SignalLog(ICQ2000::LogEvent::ERROR, ostr.str());
   }
 
@@ -553,7 +553,7 @@
 }
 
 void IckleClient::logger_file_cb(const string& msg) {
-  string log_file = BASE_DIR + "messages.log";
+  string log_file = BASE_DIR + "/messages.log";
   
   // set umask to secure value, so that if ickle.conf doesn't exist, and is created it will be safe.
   mode_t old_umask = umask(0077);
@@ -923,7 +923,7 @@
     if (m_settingsmap.count(c->getUIN()) > 0) return;
     ostringstream ostr;
 
-    ostr << CONTACT_DIR << c->getUIN() << ".user";
+    ostr << CONTACT_DIR << "/" << c->getUIN() << ".user";
 
     int n = 0;
     struct stat fs;
@@ -934,7 +934,7 @@
     while ( stat( filename.c_str(), &fs ) == 0 ) {
       ostringstream ostr;
       n++;
-      ostr << CONTACT_DIR << c->getUIN() << "-" << n << ".user";
+      ostr << CONTACT_DIR << "/" << c->getUIN() << "-" << n << ".user";
       filename = ostr.str();
     }
     m_settingsmap[c->getUIN()] = filename;
@@ -965,7 +965,7 @@
     // remove history file for mobile users as well, we will not be able to correctly
     // reuse this history file if the same user is added anyway
     if( !c->isICQContact() )
-      unlink( string(CONTACT_DIR + m_histmap[c->getUIN()]->getFilename()).c_str() );
+      unlink( string(CONTACT_DIR + "/" + m_histmap[c->getUIN()]->getFilename()).c_str() );
 
     m_histmap.erase(c->getUIN());
     m_settingsmap.erase(c->getUIN());
@@ -1035,7 +1035,7 @@
 
 void IckleClient::saveSelfContact()
 {
-  saveContact( icqclient.getSelfContact(), BASE_DIR + "self.user", true );
+  saveContact( icqclient.getSelfContact(), BASE_DIR + "/" + "self.user", true );
 }
 
 void IckleClient::loadContact(const string& s, bool self)
@@ -1132,7 +1132,7 @@
 void IckleClient::loadSelfContact()
 {
   try {
-    loadContact( BASE_DIR + "self.user", true );
+    loadContact( BASE_DIR + "/" + "self.user", true );
   } catch(runtime_error& e) {
     // ignore
   }