return ExePath;
#ifndef _WIN32
- char Buf[MAXPATHLEN], Cwd[MAXPATHLEN];
- char *PathEnv, *Directory, PathTest[MAXPATHLEN], FullExePath[MAXPATHLEN];
+ char Cwd[MAXPATHLEN];
+ char *Buf, *PathEnv, *Directory, PathTest[MAXPATHLEN], FullExePath[MAXPATHLEN];
bool FoundPath;
const char *argv0 = m_Arguments[0].c_str();
}
}
- if (realpath(FullExePath, Buf) == NULL)
+ if ((Buf = realpath(FullExePath, NULL)) == NULL)
throw exception(/*"realpath() failed"*/);
// remove filename
*LastSlash = '\0';
ExePath = string(Buf);
+
+ free(Buf);
#else /* _WIN32 */
char FullExePath[MAXPATHLEN];
#ifndef UNIX_H
#define UNIX_H
+#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#define ioctlsocket ioctl
-#ifndef PATH_MAX
-# define PATH_MAX 1024
-#endif /* PATH_MAX */
-
#define MAXPATHLEN PATH_MAX
/* default visibility takes care of exported symbols */