summaryrefslogtreecommitdiff
path: root/src/path.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-10-12 21:19:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-10-12 21:19:48 +0200
commitadc6d371af2cf356578fee6be0711d6db7f31288 (patch)
tree969a2b081f5089168a798dd945a8e0b287d02f8d /src/path.cc
parentfafc815d3b2f525e703ab9482a008201097ab90d (diff)
parent32d9c872e7abdaedb497e7403a44470676838ecb (diff)
Merge in from master.
Diffstat (limited to 'src/path.cc')
-rw-r--r--src/path.cc28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/path.cc b/src/path.cc
index 8be2f26..1b4ede3 100644
--- a/src/path.cc
+++ b/src/path.cc
@@ -26,9 +26,9 @@
*/
#include "path.h"
-#ifndef WIN32
+#ifndef __MINGW32__
#include <libgen.h>
-#endif
+#endif/*__MINGW32__*/
#include <string.h>
#include <stdlib.h>
@@ -36,7 +36,7 @@
std::string getPath(std::string file)
{
std::string p;
-#ifndef WIN32
+#ifndef __MINGW32__
char *b = strdup(file.c_str());
p = dirname(b);
free(b);
@@ -49,25 +49,3 @@ std::string getPath(std::string file)
return p;
}
-
-#ifdef TEST_PATH
-//Additional dependency files
-//deps:
-//Required cflags (autoconf vars may be used)
-//cflags:
-//Required link options (autoconf vars may be used)
-//libs:
-#include "test.h"
-
-TEST_BEGIN;
-
-std::string a = "../dir/file";
-TEST_EQUAL_STR(getPath(a), "../dir", "relative path");
-
-std::string b = "/abs/path/file";
-TEST_EQUAL_STR(getPath(b), "/abs/path", "absolute path");
-
-
-TEST_END;
-
-#endif/*TEST_PATH*/