diff options
| author | Junio C Hamano <gitster@pobox.com> | 2016-08-26 11:29:07 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2016-08-26 11:29:07 -0700 |
| commit | 3b1c6a9b6ef3a1b26f24439436a09482a3618ff3 (patch) | |
| tree | 4341fdab964965970947f2eb90354cca809f5c0a | |
| parent | e0c1ceafc5bece92d35773a75fff59497e1d9bd5 (diff) | |
| parent | 6db5967d4e6640c5a3ee3cde151c5fdde5ab508f (diff) | |
| download | git-3b1c6a9b6ef3a1b26f24439436a09482a3618ff3.tar.gz | |
Merge branch 'js/no-html-bypass-on-windows' into rt/help-unknown
* js/no-html-bypass-on-windows:
Revert "display HTML in default browser using Windows' shell API"
| -rw-r--r-- | builtin/help.c | 7 | ||||
| -rw-r--r-- | compat/mingw.c | 42 | ||||
| -rw-r--r-- | compat/mingw.h | 3 |
3 files changed, 0 insertions, 52 deletions
diff --git a/builtin/help.c b/builtin/help.c index 88480131cf..e8f79d7af5 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -379,17 +379,10 @@ static void get_html_page_path(struct strbuf *page_path, const char *page) free(to_free); } -/* - * If open_html is not defined in a platform-specific way (see for - * example compat/mingw.h), we use the script web--browse to display - * HTML. - */ -#ifndef open_html static void open_html(const char *path) { execl_git_cmd("web--browse", "-c", "help.browser", path, (char *)NULL); } -#endif static void show_html_page(const char *git_cmd) { diff --git a/compat/mingw.c b/compat/mingw.c index 2b5467dead..3fbfda5978 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 ef22cbb05d..d6e8b5e720 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -417,9 +417,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. * |
