git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] cygwin: Convert paths for html help from posix to windows

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Jan 22, 2009, 17:16 UTC
Message-ID
<20090122171605.GA16684@atjola.homenet>

When using "git help --web" with cygwin, we used to pass the posix path to the browser, but a native windows browser will expect a windows path and is unable to make use of the given path.

So the cygwin port gets its own open_html implementation that handles the path conversion.

Reported-by: Steffen Jaeckel <jaeckel@stzedn.de>
Tested-by: Steffen Jaeckel <jaeckel@stzedn.de>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
OK, I don't really know if this is the right way to do it. Maybe when
the browser was built for cygwin this breaks? I have no clue, it's
admittedly just the result of a quick glance at the code and some
googling to find the "right" cygwin function... :-/
 compat/cygwin.c |    7 +++++++
 compat/cygwin.h |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/compat/cygwin.c b/compat/cygwin.c
index ebac148..70ecd2d 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -141,3 +141,10 @@ static int cygwin_lstat_stub(const char *file_name, struct stat *buf)
 stat_fn_t cygwin_stat_fn = cygwin_stat_stub;
 stat_fn_t cygwin_lstat_fn = cygwin_lstat_stub;
 
+void cygwin_open_html(const char *unixpath)
+{
+	char cygpath[PATH_MAX];
+
+	cygwin_conv_to_win32_path(unixpath, cygpath);
+	execl_git_cmd("web--browse", "-c", "help.browser", cygpath, NULL);
+}
diff --git a/compat/cygwin.h b/compat/cygwin.h
index a3229f5..7cbefea 100644
--- a/compat/cygwin.h
+++ b/compat/cygwin.h
@@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;
 
 #define stat(path, buf) (*cygwin_stat_fn)(path, buf)
 #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)
+
+void cygwin_open_html(const char *path);
+#define open_html cygwin_open_html
-- 
1.6.1.230.gf873d
Next: Junio C Hamano
Message 1 of 6 in “cygwin: Convert paths for html help from posix to windows”
  1. cygwin: Convert paths for html help from posix to windowsBjörn Steinbrink, Jan 22, 2009
  2. Junio C HamanoJan 22, 2009
  3. Johannes SchindelinJan 22, 2009
  4. Re[2]: [PATCH] cygwin: Convert paths for html help from posix to windowsSteffen Jaeckel, Jan 22, 2009
  5. Ramsay JonesJan 24, 2009
  6. Steffen JaeckelJan 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.