X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fconfig.cpp;h=753a4ef65b0577dca6bf0301290898461cd188de;hb=0f5283a54fd188072eca23fbd980a43c6c869913;hp=816ee1abb0ea26140625d9ec13dacc518dc4987a;hpb=54aab19ee471810a956e1fee4d3b962aaf9ae9b3;p=builder.git diff --git a/source/config.cpp b/source/config.cpp index 816ee1a..753a4ef 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -157,8 +157,10 @@ void Config::finish() string value; if(is_option(var)) value=get_option(var).value; - else - value=getenv(var.c_str()); + else if(var=="arch") + value=package.get_builder().get_current_arch().get_name(); + else if(const char *ptr=getenv(var.c_str())) + value=ptr; opt.value.replace(dollar, end-dollar, value); @@ -211,7 +213,8 @@ void Config::load() try { - IO::File in(fn.str()); + IO::File inf(fn.str()); + IO::Buffered in(inf); mtime=Time::TimeStamp::from_unixtime(stat(fn).st_mtime); @@ -219,7 +222,7 @@ void Config::load() Loader loader(*this); loader.load(parser); } - catch(const SystemError &) + catch(const IO::FileNotFound &) { } }