From: sof Date: Wed, 17 Feb 1999 09:43:32 +0000 (+0000) Subject: [project @ 1999-02-17 09:43:32 by sof] X-Git-Tag: Approximately_9120_patches~6545 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=268cbd962868e4d7265ee4fbcb9d45dc7fcb4a8c;p=ghc-hetmet.git [project @ 1999-02-17 09:43:32 by sof] Perl regex tweak, take 55 --- diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl index 3fae1d1..e9f2df0 100644 --- a/ghc/driver/ghc-iface.lprl +++ b/ghc/driver/ghc-iface.lprl @@ -133,9 +133,12 @@ sub constructNewHiFile { $mod_name_dec =~ s/ZZ/Z/g; if ($Specific_hi_file eq '') { # -ohi is used even if module name != stem of filename. - ($hiname = $hifile_target) = $1 if $hifile_target =~ /\/?([^\/\.]+)\.$HiSuffix/; + ($hiname = $hifile_target) = $1 if $hifile_target =~ /\/?([^\/]+)\.$HiSuffix$/; if ( $mod_name_dec ne $hiname ) { - ($hidir = $hifile_target) =~ s/(.*)$hiname\.$HiSuffix/$1/; + $hidir = ''; + # strip off basename only if we've got a dirname. + ($hidir = $hifile_target) =~ s/(.*\/)[^\/]*$/$1/ + if ( $hifile_target =~ /\/$hiname\.$HiSuffix/ ); $hifile_target = $hidir . $mod_name_dec . ".$HiSuffix"; } }