|
a/src/index/mimetype.cpp |
|
b/src/index/mimetype.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: mimetype.cpp,v 1.6 2005-03-25 09:40:27 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: mimetype.cpp,v 1.7 2005-04-04 13:18:46 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
|
4 |
|
5 |
#include <ctype.h>
|
5 |
#include <ctype.h>
|
6 |
|
6 |
|
7 |
#include <string>
|
7 |
#include <string>
|
|
... |
|
... |
80 |
string mtype;
|
80 |
string mtype;
|
81 |
if (mtypes->get(suff, mtype, ""))
|
81 |
if (mtypes->get(suff, mtype, ""))
|
82 |
return mtype;
|
82 |
return mtype;
|
83 |
}
|
83 |
}
|
84 |
|
84 |
|
85 |
// Look at file data ? Only when no suffix
|
85 |
// Look at file data ? Only when no suffix or always
|
|
|
86 |
// Also 'file' is not that great for us. For exemple it will
|
|
|
87 |
// mistake mail folders for simple text files if there is no 'Received'
|
|
|
88 |
// header, which would be the case, for exemple in a 'Sent' folder. Also
|
|
|
89 |
// I'm not sure that file -i exists on all systems
|
86 |
if (suff.empty())
|
90 |
//if (suff.empty())
|
87 |
return mimetypefromdata(fn);
|
91 |
return mimetypefromdata(fn);
|
88 |
return "";
|
92 |
return "";
|
89 |
}
|
93 |
}
|
90 |
|
94 |
|
91 |
|
95 |
|