From 4b08d82ea49ed3990ea49e359f8d0ca265a46bed Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 23 Dec 2014 20:10:28 +0100 Subject: [PATCH] MRI: dataDirectory: Return "." if customDataPath is not defined --- binding-mri/binding-mri.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index b695c48..39f3a63 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -192,8 +192,11 @@ RB_METHOD(mriP) RB_METHOD(mkxpDataDirectory) { RB_UNUSED_PARAM; + + const std::string &path = shState->config().customDataPath; + const char *s = path.empty() ? "." : path.c_str(); - return rb_str_new_cstr(shState->config().customDataPath.c_str()); + return rb_str_new_cstr(s); } RB_METHOD(mkxpPuts)