Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mgiza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mgizapp/src/Parameter.cpp')
-rw-r--r--mgizapp/src/Parameter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/mgizapp/src/Parameter.cpp b/mgizapp/src/Parameter.cpp
index ff8c400..51ae776 100644
--- a/mgizapp/src/Parameter.cpp
+++ b/mgizapp/src/Parameter.cpp
@@ -28,6 +28,7 @@ USA.
#include <direct.h>
#define getcwd _getcwd
#endif
+#include <stdexcept>
#include <strstream>
@@ -47,7 +48,9 @@ bool writeParameters(ofstream&of,const ParSet&parset,int level)
of << (*i)->getString() << " ";
if( absolutePathNames&&(*i)->isFilename()&&s.length()&&s[0]!='/' ) {
char path[1024];
- getcwd(path,1024);
+ if (getcwd(path, 1024) == NULL)
+ throw std::runtime_error(
+ "Could not get current working directory.");
of << path << '/';
}
if( ParameterPathPrefix.length()&&(*i)->isFilename()&&s.length()&&s[0]!='/' )