#include <config.h>
#include "Lexer.h"
+#include "Format.h"
#include "support/convert.h"
#include "support/debug.h"
bool Lexer::Pimpl::setFile(FileName const & filename)
{
+#ifdef TEX2LYX
+ // tex2lyx does not read lyxrc and therefore can't really check for
+ // zipped formats.
+ if (false) {
+#else
// Check the format of the file.
- string const format = filename.guessFormatFromContents();
-
- if (format == "gzip" || format == "zip" || format == "compress") {
+ if (formats.isZippedFile(filename)) {
+#endif
LYXERR(Debug::LYXLEX, "lyxlex: compressed");
// The check only outputs a debug message, because it triggers
// a bug in compaq cxx 6.2, where is_open() returns 'true' for
// Skip byte order mark.
if (is.peek() == 0xef) {
- int c = is.get();
+ is.get();
if (is.peek() == 0xbb) {
- c = is.get();
+ is.get();
LASSERT(is.get() == 0xbf, /**/);
} else
is.unget();