summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-25 20:55:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-25 20:55:06 (GMT)
commit13e11ff707b18599dc94c25885b33b0c514b1c17 (patch)
tree7c44e79239ea5bda41ec13c87e23a8a8e6f1a681 /compat/mingw.c
parenta1f0b4e286a81898b70628c5df85bebec653deab (diff)
parent6db5967d4e6640c5a3ee3cde151c5fdde5ab508f (diff)
downloadgit-13e11ff707b18599dc94c25885b33b0c514b1c17.zip
git-13e11ff707b18599dc94c25885b33b0c514b1c17.tar.gz
git-13e11ff707b18599dc94c25885b33b0c514b1c17.tar.bz2
Merge branch 'js/no-html-bypass-on-windows'
On Windows, help.browser configuration variable used to be ignored, which has been corrected. * js/no-html-bypass-on-windows: Revert "display HTML in default browser using Windows' shell API"
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 2b5467d..3fbfda5 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1930,48 +1930,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);