summaryrefslogtreecommitdiff
path: root/Source/BoogieDriver
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2013-06-03 10:21:39 -0700
committerGravatar wuestholz <unknown>2013-06-03 10:21:39 -0700
commit6c36ef17eef694a2c3b5b144d29a4e51b5102c7c (patch)
tree2097e901533d9535151ffe3a65fd602475db311a /Source/BoogieDriver
parent734ee394898d9e37c784f32e0d105678f82d981a (diff)
Fixed an issue with discovering program snapshots.
Diffstat (limited to 'Source/BoogieDriver')
-rw-r--r--Source/BoogieDriver/BoogieDriver.cs31
1 files changed, 21 insertions, 10 deletions
diff --git a/Source/BoogieDriver/BoogieDriver.cs b/Source/BoogieDriver/BoogieDriver.cs
index a39e8696..be1266b2 100644
--- a/Source/BoogieDriver/BoogieDriver.cs
+++ b/Source/BoogieDriver/BoogieDriver.cs
@@ -161,16 +161,27 @@ namespace Microsoft.Boogie {
if (CommandLineOptions.Clo.VerifySnapshots && lookForSnapshots)
{
- var snapshots =
- from n in fileNames
- from f in Directory.GetFiles(Path.GetDirectoryName(Path.GetFullPath(n)), Path.GetFileNameWithoutExtension(n) + ".*" + Path.GetExtension(n))
- select f;
-
- var snapshotsByVersion =
- from n in snapshots
- group n by Path.GetFileNameWithoutExtension(n).Substring(Path.GetFileNameWithoutExtension(n).LastIndexOf(".")) into g
- orderby g.Key
- select g;
+ var snapshotsByVersion = new List<List<string>>();
+ for (int version = 0; true; version++)
+ {
+ var nextSnapshot = new List<string>();
+ foreach (var name in fileNames)
+ {
+ var versionedName = name.Replace(Path.GetExtension(name), ".v" + version + Path.GetExtension(name));
+ if (File.Exists(versionedName))
+ {
+ nextSnapshot.Add(versionedName);
+ }
+ }
+ if (nextSnapshot.Any())
+ {
+ snapshotsByVersion.Add(nextSnapshot);
+ }
+ else
+ {
+ break;
+ }
+ }
foreach (var s in snapshotsByVersion)
{