*** empty log message ***

This commit is contained in:
dockes
2005-04-05 09:35:35 +00:00
parent 50b927f65c
commit 68fb37b5f9
10 changed files with 137 additions and 74 deletions
+11 -6
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimetype.cpp,v 1.7 2005-04-04 13:18:46 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimetype.cpp,v 1.8 2005-04-05 09:35:35 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <ctype.h>
@@ -13,6 +13,7 @@ using std::list;
#include "debuglog.h"
#include "execmd.h"
#include "conftree.h"
#include "smallut.h"
static string mimetypefromdata(const string &fn)
{
@@ -61,8 +62,9 @@ string mimetype(const string &fn, ConfTree *mtypes)
it != stoplist.end(); it++) {
if (it->length() > fn.length())
continue;
if (!fn.compare(fn.length() - it->length(), string::npos, *it)) {
LOGDEB1(("mimetype: fn %s in stoplist (%s)\n", fn.c_str(),
if (!stringicmp(fn.substr(fn.length() - it->length(),string::npos),
*it)) {
LOGINFO(("mimetype: fn %s in stoplist (%s)\n", fn.c_str(),
it->c_str()));
return "";
}
@@ -82,13 +84,16 @@ string mimetype(const string &fn, ConfTree *mtypes)
return mtype;
}
// Look at file data ? Only when no suffix or always
// Look at file data ? Only when no suffix or always ?
// Also 'file' is not that great for us. For exemple it will
// mistake mail folders for simple text files if there is no 'Received'
// header, which would be the case, for exemple in a 'Sent' folder. Also
// I'm not sure that file -i exists on all systems
//if (suff.empty())
return mimetypefromdata(fn);
//if (suff.empty()) // causes problems with shifted files, like
// messages.1, messages.2 etc...
return mimetypefromdata(fn);
return "";
}
+5 -19
View File
@@ -1,11 +1,12 @@
#ifndef lint
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.9 2005-02-01 08:42:56 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.10 2005-04-05 09:35:35 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <stdio.h>
#include <signal.h>
#include "debuglog.h"
#include "rclinit.h"
#include "indexer.h"
ConfIndexer *indexer;
@@ -25,24 +26,9 @@ static void sigcleanup(int sig)
int main(int argc, const char **argv)
{
atexit(cleanup);
if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
signal(SIGHUP, sigcleanup);
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
signal(SIGINT, sigcleanup);
if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
signal(SIGQUIT, sigcleanup);
if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
signal(SIGTERM, sigcleanup);
RclConfig *config = recollinit(cleanup, sigcleanup);
DebugLog::getdbl()->setloglevel(DEBDEB1);
DebugLog::setfilename("stderr");
RclConfig config;
if (!config.ok()) {
fprintf(stderr, "Config could not be built\n");
exit(1);
}
indexer = new ConfIndexer(&config);
indexer = new ConfIndexer(config);
exit(!indexer->index());
}