From 22c78350229142cb504881e8ecc6dbf71d5bf57e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 13 Oct 2003 01:01:33 +0000 Subject: [PATCH] move some vars to smaller scope git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7899 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/DepTable.C | 6 +++--- src/LaTeX.C | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/DepTable.C b/src/DepTable.C index a6440486cf..2718bcacf9 100644 --- a/src/DepTable.C +++ b/src/DepTable.C @@ -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 diff --git a/src/LaTeX.C b/src/LaTeX.C index de40f6112d..7623aa3acf 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -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; -- 2.39.5