diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-09-08 21:35:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-08 21:35:55 -0700 |
commit | ba22efd8f5d9bd946925e72b5e6ede91ce2ec9be (patch) | |
tree | d3ea10c950539813a629e01cb4e0c00ee6f41317 /compat | |
parent | Merge branch 'jk/difftool-command-not-found' into maint (diff) | |
parent | Revert "display HTML in default browser using Windows' shell API" (diff) | |
download | tgif-ba22efd8f5d9bd946925e72b5e6ede91ce2ec9be.tar.xz |
Merge branch 'js/no-html-bypass-on-windows' into maint
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')
-rw-r--r-- | compat/mingw.c | 42 | ||||
-rw-r--r-- | compat/mingw.h | 3 |
2 files changed, 0 insertions, 45 deletions
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 95e128fcfd..2cadb816ee 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. * |