aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/w3mhelp.cgi.in
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-21 20:30:54 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-21 20:30:54 +0000
commit94f1eed72cb29867d6450763c0e251c372df489f (patch)
tree680e007f15a696e8e5152c2f15a22909761696ea /scripts/w3mhelp.cgi.in
parentoops, +cvs (diff)
downloadw3m-94f1eed72cb29867d6450763c0e251c372df489f.tar.gz
w3m-94f1eed72cb29867d6450763c0e251c372df489f.zip
[w3m-dev 02690] RC_DIR in scripts
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'scripts/w3mhelp.cgi.in')
-rw-r--r--scripts/w3mhelp.cgi.in27
1 files changed, 25 insertions, 2 deletions
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
index 0cf4a5b..b1e94fb 100644
--- a/scripts/w3mhelp.cgi.in
+++ b/scripts/w3mhelp.cgi.in
@@ -1,5 +1,9 @@
#!@PERL@
-# $Id: w3mhelp.cgi.in,v 1.6 2001/12/21 19:25:01 ukai Exp $
+# $Id: w3mhelp.cgi.in,v 1.7 2001/12/21 20:30:54 ukai Exp $
+
+if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
+ $CYGPATH = 1;
+}
$helpdir = "@HELP_DIR@";
unshift(@INC, $helpdir);
@@ -15,7 +19,12 @@ $lang = 'en';
'&', '&amp;'
);
-$keymap = "$ENV{'HOME'}/.w3m/keymap";
+$RC_DIR = '@RC_DIR@';
+$RC_DIR =~ s/^~/$ENV{'HOME'}/;
+if ($CYGPATH) {
+ $RC_DIR = &cygwin_pathconv("$RC_DIR");
+}
+$keymap = "$RC_DIR/keymap";
$version = '*unknown*';
if (defined($ENV{'QUERY_STRING'})) {
print "QUERY_STRING=$ENV{'QUERY_STRING'}\n";
@@ -191,3 +200,17 @@ PAGE
}
print "</table>\n";
}
+
+
+sub cygwin_pathconv {
+ local($_) = @_;
+ local(*CYGPATH);
+
+ open(CYGPATH, '-|') || exec('cygpath', '-w', $_);
+ $_ = <CYGPATH>;
+ close(CYGPATH);
+ s/\r?\n$//;
+ s!\\!/!g;
+ s!/$!!;
+ return $_;
+}