aboutsummaryrefslogtreecommitdiff
path: root/win32/mingw.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/mingw.c')
-rw-r--r--win32/mingw.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index d5d944a9d..606a48319 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -2142,13 +2142,12 @@ const char *need_system_drive(const char *path)
2142 return NULL; 2142 return NULL;
2143} 2143}
2144 2144
2145/* Allocate a string long enough to allow a system drive prefix and 2145/* Copy path to an allocated string long enough to allow a file extension
2146 * file extension to be added to path. Add the prefix if necessary. */ 2146 * to be added. */
2147char *alloc_system_drive(const char *path) 2147char *alloc_ext_space(const char *path)
2148{ 2148{
2149 const char *sd = need_system_drive(path); 2149 char *s = xmalloc(strlen(path) + 5);
2150 char *s = xmalloc(strlen(path) + 5 + (sd ? strlen(sd) : 0)); 2150 strcpy(s, path);
2151 strcpy(stpcpy(s, sd ?: ""), path);
2152 return s; 2151 return s;
2153} 2152}
2154 2153