From c48c06182b4660794d924775cf55b0675a7798e4 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 30 Mar 2009 12:41:31 +0200 Subject: [PATCH] Clean up own directory access Use dirname() from File::Basename instead of custom regexps to access our directory. Also use readlink() when not in Windows so that symlinking MMD somewhere in the PATH works. --- bin/MultiMarkdown.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/MultiMarkdown.pl b/bin/MultiMarkdown.pl index ce2c6ea..88fd69c 100755 --- a/bin/MultiMarkdown.pl +++ b/bin/MultiMarkdown.pl @@ -32,6 +32,7 @@ package Markdown; require 5.006_000; use strict; use warnings; +use File::Basename; # Include ASCIIMathML.pm my $me = $0; # Where am I? @@ -40,9 +41,9 @@ use warnings; my $os = $^O; if ($os =~ /MSWin/) { - $me =~ s/\\([^\\]*?)$/\\/; # Get just the directory portion + $me = dirname($me)."\\"; # Get just the directory portion } else { - $me =~ s/\/([^\/]*?)$/\//; # Get just the directory portion + $me = dirname(readlink($me))."/"; # Get just the directory portion } require $me ."ASCIIMathML.pm"; -- 2.32.0.93.g670b81a890