summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/Util.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-11-29 21:00:15 +0000
committerMarc Laukien <marc@zeroc.com>2004-11-29 21:00:15 +0000
commit96dd240e1ac93a97518688898a794374cb221e39 (patch)
treee56dba9ffc763ce9d0fdc23b53db514cae434cd6 /cpp/src/IcePatch2/Util.cpp
parentfixes (diff)
downloadice-96dd240e1ac93a97518688898a794374cb221e39.tar.bz2
ice-96dd240e1ac93a97518688898a794374cb221e39.tar.xz
ice-96dd240e1ac93a97518688898a794374cb221e39.zip
fixes
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r--cpp/src/IcePatch2/Util.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp
index 1614b1e8fbc..d0b62270d5d 100644
--- a/cpp/src/IcePatch2/Util.cpp
+++ b/cpp/src/IcePatch2/Util.cpp
@@ -756,24 +756,40 @@ IcePatch2::loadFileInfoSeq(const string& pa, FileInfoSeq& infoSeq)
}
}
+ bool save = false;
+
{
const string pathLog = normalize(pa + ".log");
ifstream is(pathLog.c_str());
- while(is.good())
+ if(is)
{
- FileInfo info;
- is >> info;
-
- if(is.good())
+ save = true;
+
+ while(is.good())
{
- infoSeq.push_back(info);
+ FileInfo info;
+ is >> info;
+
+ if(is.good())
+ {
+ infoSeq.push_back(info);
+ }
}
}
}
sort(infoSeq.begin(), infoSeq.end(), FileInfoLess());
infoSeq.erase(unique(infoSeq.begin(), infoSeq.end(), FileInfoEqual()), infoSeq.end());
+
+ //
+ // If we merged the sequence with a log file, we save this new
+ // merged sequence and remove the log file.
+ //
+ if(save)
+ {
+ saveFileInfoSeq(pa, infoSeq);
+ }
}
void