QUIC DEMUX: (Server support) Add support for default handler
[openssl.git] / util / mkpod2html.pl
index 9e81d36653d317d082960de2981cdd6b71bf73af..ea1164d597c9ec9b71f2ba19cfe21af2f450714c 100755 (executable)
@@ -12,6 +12,7 @@ use warnings;
 use lib ".";
 use Getopt::Std;
 use Pod::Html;
+use File::Spec::Functions qw(:DEFAULT rel2abs);
 
 # Options.
 our($opt_i);    # -i INFILE
@@ -25,6 +26,14 @@ die "-o flag missing" unless $opt_o;
 die "-t flag missing" unless $opt_t;
 die "-r flag missing" unless $opt_r;
 
+# We originally used realpath() here, but the Windows implementation appears
+# to require that the directory or file exist to be able to process the input,
+# so we use rel2abs() instead, which only processes the string without
+# looking further.
+$opt_i = rel2abs($opt_i) or die "Can't convert to real path: $!";
+$opt_o = rel2abs($opt_o) or die "Can't convert to real path: $!";
+$opt_r = rel2abs($opt_r) or die "Can't convert to real path: $!";
+
 pod2html
     "--infile=$opt_i",
     "--outfile=$opt_o",
@@ -45,7 +54,7 @@ close F;
 unlink $opt_o;
 
 $contents =~
-    s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html|g;
+    s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html"|g;
 open F, ">$opt_o"
     or die "Can't write $opt_o, $!";
 print F $contents;