summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-08-19 10:39:38 +0200
committerJunio C Hamano <gitster@pobox.com>2016-08-19 13:47:28 -0700
commit6db5967d4e6640c5a3ee3cde151c5fdde5ab508f (patch)
tree4104e0be2ac634cb0c47472658184f1d5f0632dd /compat
parent0b65a8dbdb38962e700ee16776a3042beb489060 (diff)
downloadgit-6db5967d4e6640c5a3ee3cde151c5fdde5ab508f.tar.gz
Revert "display HTML in default browser using Windows' shell API"js/no-html-bypass-on-windows
Since 4804aab (help (Windows): Display HTML in default browser using Windows' shell API, 2008-07-13), Git for Windows used to call `ShellExecute()` to launch the default Windows handler for `.html` files. The idea was to avoid going through a shell script, for performance reasons. However, this change ignores the `help.browser` config setting. Together with browsing help not being a performance-critical operation, let's just revert that patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c42
-rw-r--r--compat/mingw.h3
2 files changed, 0 insertions, 45 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index a8218e6f0f..88a3242360 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);
diff --git a/compat/mingw.h b/compat/mingw.h
index 69bb43dc35..17794e17a4 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -414,9 +414,6 @@ int mingw_offset_1st_component(const char *path);
#include <inttypes.h>
#endif
-void mingw_open_html(const char *path);
-#define open_html mingw_open_html
-
/**
* Converts UTF-8 encoded string to UTF-16LE.
*