summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc3b7a9)
raw | patch | inline | side by side (parent: cc3b7a9)
author | Johannes Sixt <johannes.sixt@telecom.at> | |
Sun, 22 Jun 2008 09:35:21 +0000 (11:35 +0200) | ||
committer | Johannes Sixt <johannes.sixt@telecom.at> | |
Thu, 26 Jun 2008 06:47:16 +0000 (08:47 +0200) |
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 28d32969b949a987e88007a5b7fe472ab3f93ac4..3a05fe7da656ebb5d1699937013a1ab517bbee3c 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
return ret;
}
+#undef getenv
+char *mingw_getenv(const char *name)
+{
+ char *result = getenv(name);
+ if (!result && !strcmp(name, "TMPDIR")) {
+ /* on Windows it is TMP and TEMP */
+ result = getenv("TMP");
+ if (!result)
+ result = getenv("TEMP");
+ }
+ return result;
+}
+
/*
* See http://msdn2.microsoft.com/en-us/library/17w5ykft(vs.71).aspx
* (Parsing C++ Command-Line Arguments)
diff --git a/compat/mingw.h b/compat/mingw.h
index 624b32d1f404229efcbc0e229703e874e6275fdf..a87cc9679cd32dea102034348f77abb6e12e0113 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
char *mingw_getcwd(char *pointer, int len);
#define getcwd mingw_getcwd
+char *mingw_getenv(const char *name);
+#define getenv mingw_getenv
+
struct hostent *mingw_gethostbyname(const char *host);
#define gethostbyname mingw_gethostbyname