]> git.lyx.org Git - features.git/commitdiff
fix order of fields in deptable
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Jan 2003 09:54:18 +0000 (09:54 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Jan 2003 09:54:18 +0000 (09:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5918 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/DepTable.C

index 63cebf4818b87967e26cd6faa7cc3dbb31650010..c67685cf8563c147d2a91c7034428727ce53ccf5 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-20  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * DepTable.C (write): write the file name as last element of the
+       .dep file (because it may contain spaces)
+       (read): read info in the right order
+
 2003-01-07  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * paragraph_pimpl.C (simpleTeXBlanks): 
index 6ee37d40935ea5c2202471c70078dc2df8481840..c148a7e8652d8b0bd924f68b921aea3926d74975 100644 (file)
@@ -41,6 +41,7 @@ using std::ofstream;
 using std::ifstream;
 using std::flush;
 using std::endl;
+using std::getline;
 
 
 inline
@@ -225,13 +226,13 @@ void DepTable::write(string const & f) const
                        // CRC value.
                        // The older one is effectively set to 0 upon re-load.
                        lyxerr << "Write dep: "
-                              << cit->first << ' '
                               << cit->second.crc_cur << ' '
-                              << cit->second.mtime_cur << endl;
+                              << cit->second.mtime_cur << ' '
+                              << cit->first << endl;
                }
-               ofs << cit->first << ' '
-                   << cit->second.crc_cur << ' '
-                   << cit->second.mtime_cur << endl;
+               ofs << cit->second.crc_cur << ' '
+                   << cit->second.mtime_cur << ' '
+                   << cit->first << endl;
        }
 }
 
@@ -244,12 +245,13 @@ void DepTable::read(string const & f)
        // This doesn't change through the loop.
        di.crc_prev = 0;
 
-       while (ifs >> nome >> di.crc_cur >> di.mtime_cur) {
+       while (ifs >> di.crc_cur >> di.mtime_cur && getline(ifs, nome)) {
+               nome = ltrim(nome);
                if (lyxerr.debugging(Debug::DEPEND)) {
                        lyxerr << "Read dep: "
-                              << nome << ' '
                               << di.crc_cur << ' '
-                              << di.mtime_cur << endl;
+                              << di.mtime_cur << ' '
+                              << nome << endl;
                }
                deplist[nome] = di;
        }