]> git.lyx.org Git - features.git/commitdiff
* src/LaTeX.C (deplog): fix the regex to parse filenames in the log file
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 13 Feb 2007 17:31:43 +0000 (17:31 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 13 Feb 2007 17:31:43 +0000 (17:31 +0000)
(fixes bug 3224)
*src/support/filename.C: limit asserts to windows platform
(fixes bug 3132)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17163 a592a061-630c-0410-9148-cb99ea01b6c8

src/LaTeX.C
src/support/filename.C

index b8caf83b607aa2bf65056589af6a3ad41688edc2..5a8b81f761a59f4c81655b8bd296d9d879a5864f 100644 (file)
@@ -822,9 +822,11 @@ void LaTeX::deplog(DepTable & head)
                // Ok, the scanning of files here is not sufficient.
                // Sometimes files are named by "File: xxx" only
                // So I think we should use some regexps to find files instead.
-               // "(\([^ ]+\)"   should match the "(file " variant, note
-               // that we can have several of these on one line.
-               // "File: \([^ ]+\)" should match the "File: file" variant
+               // "\(([^ ()]+\.+[^ ()]+)" should match the "(file.ext " variant,
+               //  note that we can have several of these on one line.
+               // "File: ([^\.]+\.+[^ ]+).*" should match the "File: file.ext " variant.
+               // FIXME: sometimes, LaTeX inserts linebreaks while outputting
+               // file names. This case is not handled correctly (bug 1027).
 
                string token;
                getline(ifs, token);
@@ -844,7 +846,9 @@ void LaTeX::deplog(DepTable & head)
                token = to_utf8(from_filesystem8bit(token));
 
                if (regex_match(token, sub, reg1)) {
-                       static regex reg1_1("\\(([^()]+)");
+                       // search for strings in (...) that must not contain
+                       // a blank, but must contain a dot
+                       static regex reg1_1("\\(([^()]+\\.+[^ ()]+)");
                        smatch what;
                        string::const_iterator first = token.begin();
                        string::const_iterator end = token.end();
index 280525be7a6a0049386e8a00b149a53a3b0f99f9..30ed474054b700583d4fef50791f9b54ead9cee5 100644 (file)
@@ -45,7 +45,9 @@ FileName::FileName(string const & abs_filename)
        : name_(abs_filename)
 {
        BOOST_ASSERT(empty() || absolutePath(name_));
+#if defined(_WIN32)
        BOOST_ASSERT(!contains(name_, '\\'));
+#endif
 }
 
 
@@ -53,7 +55,9 @@ void FileName::set(string const & name)
 {
        name_ = name;
        BOOST_ASSERT(absolutePath(name_));
+#if defined(_WIN32)
        BOOST_ASSERT(!contains(name_, '\\'));
+#endif
 }