summaryrefslogtreecommitdiff
path: root/src/path.cc
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-29 17:03:13 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-31 17:44:25 +0200
commite03a52fe134e386c543bc1a83e21114ecedb7561 (patch)
tree83f6ad7d0157cdd4688e2791d6a90245cd862244 /src/path.cc
parentc5a62b5490c45995eb2192d0ca8d7acdb9ee35fe (diff)
API Refactoring for getPath function
Diffstat (limited to 'src/path.cc')
-rw-r--r--src/path.cc20
1 files changed, 10 insertions, 10 deletions
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 <string.h>
#include <stdlib.h>
-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;
}