Changeset 579 for trunk/bin/Parameter.cc


Ignore:
Timestamp:
Mar 18, 2008, 3:11:51 PM (13 years ago)
Author:
Peter Johansson
Message:

Merged patch release 0.6.5 to the trunk. Delta 0.6.5 - 0.6.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r544 r579  
    33/*
    44  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2008 Peter Johansson
    56
    67  This file is part of svndigest, http://trac.thep.lu.se/svndigest
     
    146147    string workdir(pwd()); // remember current working directory (cwd).
    147148
     149    bool root_ok = node_exist(root_) && !access_rights(root_, "r");
     150   
     151    if (root_ok) {
     152      // Check that root_ is a directory
     153      struct stat nodestat;
     154      stat(root_.c_str(), &nodestat);
     155      if (!S_ISDIR(nodestat.st_mode))
     156        throw runtime_error(string("svndigest: accessing `") + root_ +
     157                            "': Not a directory.");
     158    }
     159
    148160    // Checking that root_ exists and retrieve the absolute path to root_
    149     if (chdir(root_.c_str()))
     161    if (!root_ok || chdir(root_.c_str()))
    150162      throw runtime_error(string("svndigest: Root directory (") + root_ +
    151163                          ") access failed.");
    152164    root_ = pwd();
     165
     166     
    153167
    154168    // need to get back to cwd if relative paths are used.
Note: See TracChangeset for help on using the changeset viewer.