From e03a52fe134e386c543bc1a83e21114ecedb7561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 17:03:13 +0200 Subject: API Refactoring for getPath function --- src/path.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/path.cc') diff --git a/src/path.cc b/src/path.cc index 5c899f2..43c64f0 100644 --- a/src/path.cc +++ b/src/path.cc @@ -33,19 +33,19 @@ #include #include -std::string getPath(std::string file) +std::string getPath(const std::string& file) { - std::string p; + std::string p; #ifndef __MINGW32__ - char *b = strdup(file.c_str()); - p = dirname(b); - free(b); + char *b = strdup(file.c_str()); + p = dirname(b); + free(b); #else - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - _splitpath(file.c_str(), drive, dir, NULL, NULL); - p = std::string(drive) + dir; + char drive[_MAX_DRIVE]; + char dir[_MAX_DIR]; + _splitpath(file.c_str(), drive, dir, NULL, NULL); + p = std::string(drive) + dir; #endif - return p; + return p; } -- cgit v1.2.3