Changeset 117 for trunk/bin/Parameter.cc


Ignore:
Timestamp:
Jun 30, 2006, 2:46:22 PM (17 years ago)
Author:
Peter Johansson
Message:

fixed bug with root and target

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r116 r117  
    8585  {
    8686
     87    // making root absolute
     88    std::string workdir(pwd());
     89    chdir(root_.c_str());
     90    root_ = pwd();
     91    // remove trailing '/'
     92    if (*root_.rbegin()=='/')
     93      root_.erase(root_.begin()+root_.size()-1);
     94    chdir(workdir.c_str());
     95
     96    // making targetdir absolute
     97    chdir(targetdir_.c_str());
     98    targetdir_ = pwd();
     99    // remove trailing '/'
     100    if (*targetdir_.rbegin()=='/')
     101      root_.erase(targetdir_.begin()+targetdir_.size()-1);
     102    chdir(workdir.c_str());
     103
    87104    struct stat buf;
    88105    // check that root directory exists
     
    95112                               ": No such directory.");
    96113    }
    97      
    98     // making root absolute
    99     std::string workdir(pwd());
    100     chdir(root_.c_str());
    101     root_ = pwd();
    102     // remove trailing '/'
    103     if (*root_.rbegin()=='/')
    104       root_.erase(root_.begin()+root_.size()-1);
    105 
    106     // making targetdir absolute
    107     chdir(targetdir_.c_str());
    108     targetdir_ = pwd();
    109     // remove trailing '/'
    110     if (*targetdir_.rbegin()=='/')
    111       root_.erase(targetdir_.begin()+targetdir_.size()-1);
    112 
    113     chdir(workdir.c_str());
    114114
    115115  }
Note: See TracChangeset for help on using the changeset viewer.