Changeset 1091


Ignore:
Timestamp:
Jun 12, 2010, 8:14:08 PM (11 years ago)
Author:
Peter Johansson
Message:

fixes #454. fail if config file is directory rather than require it's a regular file

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r1085 r1091  
    114114      check_readable(config_file_.value());
    115115      stat(config_file_.value().c_str(), &nodestat);
    116       if (!S_ISREG(nodestat.st_mode)) {
     116      if (S_ISDIR(nodestat.st_mode)) {
    117117        std::stringstream ss;
    118118        ss << cmd_.program_name() << ": `" << config_file_.value()
    119            << "' is not a regular file";
     119           << "' is a directory";
    120120        throw yat::utility::cmd_error(ss.str());
    121121      }
  • trunk/test/Makefile.am

    r1089 r1091  
    5050
    5151# tests not yet passing are listed here
    52 XFAIL_TESTS = config3_test.sh
     52XFAIL_TESTS =
    5353
    5454noinst_HEADERS = Suite.h
  • trunk/test/config3_test.sh

    r1089 r1091  
    2424set -e
    2525
    26 test -e /dev/null
    27 test -r /dev/null
     26test -e /dev/null || exit_skip
     27test -r /dev/null || exit_skip
    2828$SVNDIGEST -g --config-file /dev/null || exit_fail
     29$SVNDIGEST -g --config-file . && exit_fail
    2930
    3031exit_success
Note: See TracChangeset for help on using the changeset viewer.