Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: jaeckel@stzedn.de, git@vger.kernel.org
Subject: [PATCH] cygwin: Convert paths for html help from posix to windows
Date: Thu, 22 Jan 2009 18:16:05 +0100	[thread overview]
Message-ID: <20090122171605.GA16684@atjola.homenet> (raw)

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

             reply	other threads:[~2009-01-22 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 17:16 Björn Steinbrink [this message]
2009-01-22 17:25 ` [PATCH] cygwin: Convert paths for html help from posix to windows Junio C Hamano
2009-01-22 17:30   ` Johannes Schindelin
2009-01-22 19:34     ` Re[2]: " Steffen Jaeckel
2009-01-24 18:51 ` Ramsay Jones
2009-01-26 10:05   ` Steffen Jaeckel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090122171605.GA16684@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jaeckel@stzedn.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox