diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-09-20 16:08:52 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-09-20 16:08:52 +0200 |
commit | 5591f1602e6171492f5e4620e67d3addeacad7aa (patch) | |
tree | a51c16d5760cd7db9b1fbbf5bf3afeb9bae4ab18 /src/path.cc | |
parent | 6611e83df0ed5b9bed42ff8cd549da0b5df11df2 (diff) |
VSTi plugin version.
Diffstat (limited to 'src/path.cc')
-rw-r--r-- | src/path.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/path.cc b/src/path.cc index 3812b87..8be2f26 100644 --- a/src/path.cc +++ b/src/path.cc @@ -26,15 +26,27 @@ */ #include "path.h" +#ifndef WIN32 #include <libgen.h> +#endif + #include <string.h> #include <stdlib.h> std::string getPath(std::string file) { + std::string p; +#ifndef WIN32 char *b = strdup(file.c_str()); - std::string p = dirname(b); + 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; +#endif + return p; } |