From cd64fb84b7ef64ec2f0d9eedd83f4c514b11773e Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 5 Jan 2015 17:37:41 -0500 Subject: [PATCH] Make fortplan use Filesystem::getcwd() --- plugins/fortplan.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/fortplan.cpp b/plugins/fortplan.cpp index 2776064ae..cbd4bd346 100644 --- a/plugins/fortplan.cpp +++ b/plugins/fortplan.cpp @@ -1,6 +1,7 @@ #include "buildingplan-lib.h" #include #include +#include "modules/Filesystem.h" DFHACK_PLUGIN("fortplan"); #define PLUGIN_VERSION 0.15 @@ -113,11 +114,6 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) return CR_OK; } -std::string get_working_path() -{ - char temp[MAXPATHLEN]; - return ( getcwd(temp, MAXPATHLEN) ? std::string( temp ) : std::string("") ); -} std::vector> tokenizeFile(std::string filename) { std::ifstream infile(filename.c_str()); @@ -164,7 +160,7 @@ command_result fortplan(color_ostream &out, vector & params) { DFHack::Gui::getCursorCoords(startCursor.x, startCursor.y, startCursor.z); userCursor = startCursor; - std::string cwd = get_working_path(); + std::string cwd = Filesystem::getcwd(); std::string filename = cwd+"/"+params[0]; con.print("Loading file '%s'...\n",filename.c_str()); try { @@ -376,4 +372,4 @@ command_result fortplan(color_ostream &out, vector & params) { } return CR_OK; -} \ No newline at end of file +}