#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef _WIN32
+#include <direct.h>
+#endif
#include "misc.h"
#include "file.h"
char *slash;
char *cwd = getcwd(NULL, 0);
+#ifdef _WIN32
+ econfig = _fullpath(NULL, econfig, 0);
+ slash = strrchr(econfig, '\\');
+ configdir = malloc(slash - econfig + 1);
+ memcpy(configdir, econfig, slash - econfig);
+ configdir[slash - econfig] = 0;
+#else
if ((slash = strrchr(econfig, '/'))) {
configdir = malloc(slash - econfig + 1);
memcpy(configdir, econfig, slash - econfig);
sprintf(configdir, "%s/%s", cwd, tmp);
free(tmp);
}
+#endif /* !_WIN32 */
free(cwd);
}