|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
|
... |
|
... |
21 |
#include <fcntl.h>
|
21 |
#include <fcntl.h>
|
22 |
#include <stdio.h>
|
22 |
#include <stdio.h>
|
23 |
#include <errno.h>
|
23 |
#include <errno.h>
|
24 |
#include <langinfo.h>
|
24 |
#include <langinfo.h>
|
25 |
#include <limits.h>
|
25 |
#include <limits.h>
|
|
|
26 |
#include <sys/param.h>
|
26 |
|
27 |
|
27 |
#include <algorithm>
|
28 |
#include <algorithm>
|
28 |
#include <list>
|
29 |
#include <list>
|
29 |
using std::list;
|
30 |
using std::list;
|
30 |
|
31 |
|
|
... |
|
... |
58 |
|
59 |
|
59 |
// We default to a case- and diacritics-less index for now
|
60 |
// We default to a case- and diacritics-less index for now
|
60 |
bool o_index_stripchars = true;
|
61 |
bool o_index_stripchars = true;
|
61 |
|
62 |
|
62 |
string RclConfig::o_localecharset;
|
63 |
string RclConfig::o_localecharset;
|
|
|
64 |
string RclConfig::o_origcwd;
|
63 |
|
65 |
|
64 |
bool ParamStale::needrecompute()
|
66 |
bool ParamStale::needrecompute()
|
65 |
{
|
67 |
{
|
66 |
LOGDEB2(("ParamStale:: needrecompute. parent gen %d mine %d\n",
|
68 |
LOGDEB2(("ParamStale:: needrecompute. parent gen %d mine %d\n",
|
67 |
parent->m_keydirgen, savedkeydirgen));
|
69 |
parent->m_keydirgen, savedkeydirgen));
|
|
... |
|
... |
116 |
}
|
118 |
}
|
117 |
|
119 |
|
118 |
RclConfig::RclConfig(const string *argcnf)
|
120 |
RclConfig::RclConfig(const string *argcnf)
|
119 |
{
|
121 |
{
|
120 |
zeroMe();
|
122 |
zeroMe();
|
|
|
123 |
|
|
|
124 |
if (o_origcwd.empty()) {
|
|
|
125 |
char buf[MAXPATHLEN];
|
|
|
126 |
if (getcwd(buf, MAXPATHLEN)) {
|
|
|
127 |
o_origcwd = string(buf);
|
|
|
128 |
} else {
|
|
|
129 |
fprintf(stderr, "recollxx: can't retrieve current working directory: relative path translations will fail\n");
|
|
|
130 |
}
|
|
|
131 |
}
|
|
|
132 |
|
121 |
// Compute our data dir name, typically /usr/local/share/recoll
|
133 |
// Compute our data dir name, typically /usr/local/share/recoll
|
122 |
const char *cdatadir = getenv("RECOLL_DATADIR");
|
134 |
const char *cdatadir = getenv("RECOLL_DATADIR");
|
123 |
if (cdatadir == 0) {
|
135 |
if (cdatadir == 0) {
|
124 |
// If not in environment, use the compiled-in constant.
|
136 |
// If not in environment, use the compiled-in constant.
|
125 |
m_datadir = RECOLL_DATADIR;
|
137 |
m_datadir = RECOLL_DATADIR;
|