aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 22e62232d..260bc82d7 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1033,6 +1033,12 @@ int has_exe_suffix(const char *name)
1033 return has_win_suffix(name, 0); 1033 return has_win_suffix(name, 0);
1034} 1034}
1035 1035
1036int has_exe_suffix_or_dot(const char *name)
1037{
1038 int len = strlen(name);
1039 return (len > 0 && name[len-1] == '.') || has_win_suffix(name, 0);
1040}
1041
1036/* check if path can be made into an executable by adding a suffix; 1042/* check if path can be made into an executable by adding a suffix;
1037 * return an allocated string containing the path if it can; 1043 * return an allocated string containing the path if it can;
1038 * return NULL if not. 1044 * return NULL if not.
@@ -1044,7 +1050,7 @@ char *add_win32_extension(const char *p)
1044 char *path; 1050 char *path;
1045 int i, len; 1051 int i, len;
1046 1052
1047 if (has_exe_suffix(p)) { 1053 if (has_exe_suffix_or_dot(p)) {
1048 return NULL; 1054 return NULL;
1049 } 1055 }
1050 1056