]> git.lyx.org Git - lyx.git/commitdiff
move some vars to smaller scope
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 13 Oct 2003 01:01:33 +0000 (01:01 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 13 Oct 2003 01:01:33 +0000 (01:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7899 a592a061-630c-0410-9148-cb99ea01b6c8

src/DepTable.C
src/LaTeX.C

index a6440486cf2b0b323aa58aae8aad4ff347ae8d92..2718bcacf934fb4d4565f341fa376f4bcb95ebe4 100644 (file)
@@ -87,12 +87,12 @@ void DepTable::update()
                if (stat(itr->first.c_str(), &f_info) == 0) {
                        if (di.mtime_cur == f_info.st_mtime) {
                                di.crc_prev = di.crc_cur;
-                               lyxerr[Debug::DEPEND] << itr->first << " same mtime";
+                               lyxerr[Debug::DEPEND] << itr->first << " same mtime" << endl;
                        } else {
                                di.crc_prev = di.crc_cur;
-                               lyxerr[Debug::DEPEND] << itr->first << " CRC... ";
+                               lyxerr[Debug::DEPEND] << itr->first << " CRC... " << flush;
                                di.crc_cur = sum(itr->first);
-                               lyxerr[Debug::DEPEND] << "done";
+                               lyxerr[Debug::DEPEND] << "done" << endl;
                        }
                } else {
                        // file doesn't exist
index de40f6112dc900db01de63875144c513c96a55f9..7623aa3acfff738ffd18a6c30dd51219d432ed63 100644 (file)
@@ -676,11 +676,8 @@ namespace {
 
 void handleFoundFile(string const & ff, DepTable & head)
 {
-       static regex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
-
        // convert from native os path to unix path
        string const foundfile = os::internal_path(trim(ff));
-       string const onlyfile = OnlyFilename(foundfile);
 
        lyxerr[Debug::DEPEND] << "Found file: " << foundfile << endl;
 
@@ -701,18 +698,23 @@ void handleFoundFile(string const & ff, DepTable & head)
                // the latex run.
                if (FileInfo(foundfile).exist())
                        head.insert(foundfile, true);
+
+               return;
        }
 
+       string const onlyfile = OnlyFilename(foundfile);
+
        // (2) foundfile is in the tmpdir
        //     insert it into head
-       else if (FileInfo(onlyfile).exist()) {
-               if (regex_match(foundfile, unwanted)) {
+       if (FileInfo(onlyfile).exist()) {
+               static regex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
+               if (regex_match(onlyfile, unwanted)) {
                        lyxerr[Debug::DEPEND]
                                << "We don't want "
                                << onlyfile
                                << " in the dep file"
                                << endl;
-               } else if (suffixIs(foundfile, ".tex")) {
+               } else if (suffixIs(onlyfile, ".tex")) {
                        // This is a tex file generated by LyX
                        // and latex is not likely to change this
                        // during its runs.
@@ -720,7 +722,7 @@ void handleFoundFile(string const & ff, DepTable & head)
                                << "Tmpdir TeX file: "
                                << onlyfile
                                << endl;
-                       head.insert(foundfile, true);
+                       head.insert(onlyfile, true);
                } else {
                        lyxerr[Debug::DEPEND]
                                << "In tmpdir file:"
@@ -767,7 +769,8 @@ void LaTeX::deplog(DepTable & head)
                string token;
                getline(ifs, token);
                token = rtrim(token, "\r");
-               if (token.empty()) continue;
+               if (token.empty())
+                       continue;
 
                smatch sub;