verify_dotfile: mention case-insensitivity in comment
[gitweb.git] / compat / mingw.c
index a8218e6f0f2177e769cf3841b1c7d7d9b9ed270d..fe0e3ccd24887a830b99dabb9c66db668ba4f566 100644 (file)
@@ -961,8 +961,10 @@ static char **get_path_split(void)
                        ++n;
                }
        }
-       if (!n)
+       if (!n) {
+               free(envpath);
                return NULL;
+       }
 
        ALLOC_ARRAY(path, n + 1);
        p = envpath;
@@ -1930,48 +1932,6 @@ int mingw_raise(int sig)
        }
 }
 
-
-static const char *make_backslash_path(const char *path)
-{
-       static char buf[PATH_MAX + 1];
-       char *c;
-
-       if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
-               die("Too long path: %.*s", 60, path);
-
-       for (c = buf; *c; c++) {
-               if (*c == '/')
-                       *c = '\\';
-       }
-       return buf;
-}
-
-void mingw_open_html(const char *unixpath)
-{
-       const char *htmlpath = make_backslash_path(unixpath);
-       typedef HINSTANCE (WINAPI *T)(HWND, const char *,
-                       const char *, const char *, const char *, INT);
-       T ShellExecute;
-       HMODULE shell32;
-       int r;
-
-       shell32 = LoadLibrary("shell32.dll");
-       if (!shell32)
-               die("cannot load shell32.dll");
-       ShellExecute = (T)GetProcAddress(shell32, "ShellExecuteA");
-       if (!ShellExecute)
-               die("cannot run browser");
-
-       printf("Launching default browser to display HTML ...\n");
-       r = HCAST(int, ShellExecute(NULL, "open", htmlpath,
-                               NULL, "\\", SW_SHOWNORMAL));
-       FreeLibrary(shell32);
-       /* see the MSDN documentation referring to the result codes here */
-       if (r <= 32) {
-               die("failed to launch browser for %.*s", MAX_PATH, unixpath);
-       }
-}
-
 int link(const char *oldpath, const char *newpath)
 {
        typedef BOOL (WINAPI *T)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
@@ -2162,7 +2122,7 @@ int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen)
        return -1;
 }
 
-static void setup_windows_environment()
+static void setup_windows_environment(void)
 {
        char *tmp = getenv("TMPDIR");
 
@@ -2204,7 +2164,7 @@ typedef struct {
 extern int __wgetmainargs(int *argc, wchar_t ***argv, wchar_t ***env, int glob,
                _startupinfo *si);
 
-static NORETURN void die_startup()
+static NORETURN void die_startup(void)
 {
        fputs("fatal: not enough memory for initialization", stderr);
        exit(128);
@@ -2224,7 +2184,7 @@ static char *wcstoutfdup_startup(char *buffer, const wchar_t *wcs, size_t len)
        return memcpy(malloc_startup(len), buffer, len);
 }
 
-void mingw_startup()
+void mingw_startup(void)
 {
        int i, maxlen, argc;
        char *buffer;