[Liblas-commits] hg-main-tree: handle case where file missing

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Apr 27 14:15:04 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/9f1cbfe77af3
changeset: 677:9f1cbfe77af3
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Wed Apr 27 11:14:50 2011 -0700
description:
handle case where file missing

diffstat:

 test/unit/Support.cpp |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 28435427ec55 -r 9f1cbfe77af3 test/unit/Support.cpp
--- a/test/unit/Support.cpp	Wed Apr 27 10:54:30 2011 -0700
+++ b/test/unit/Support.cpp	Wed Apr 27 11:14:50 2011 -0700
@@ -55,6 +55,10 @@
 
 bool Support::compare_files(const std::string& file1, const std::string& file2)
 {
+    if (!libpc::Utils::fileExists(file1) ||
+        !libpc::Utils::fileExists(file2))
+        return false;
+
     uintmax_t len1x = libpc::Utils::fileSize(file1);
     uintmax_t len2x = libpc::Utils::fileSize(file2);
     size_t len1 = (size_t)len1x; // BUG


More information about the Liblas-commits mailing list