From af5d6df34fba104965560df53eaa32f0c5b5359b Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Tue, 19 Jan 1999 08:33:14 +0000
Subject: [PATCH] [project @ 1999-01-19 08:33:14 by sof] constructNewHiFile:
 regular expressions which substituted new module filename for old in
 hifile_target, didn't quite work.

---
 ghc/driver/ghc-iface.lprl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl
index 02c079391e47..491b2af7f9cb 100644
--- a/ghc/driver/ghc-iface.lprl
+++ b/ghc/driver/ghc-iface.lprl
@@ -124,9 +124,9 @@ sub constructNewHiFile {
 
     &readHiFile('new',$hsc_hi)	      unless $HiHasBeenRead{'new'} == 1;
     if ($Specific_hi_file eq '') {  # -ohi is used even if  module name != stem of filename.
-        ($hiname = $hifile_target) =~ s/([^\/]*\/)*(.*)\.$HiSuffix/$2/;
+        ($hiname = $hifile_target) = $1 if  $hifile_target =~ /\/?([^\/\.]+)\.$HiSuffix/;
         if ($ModuleName{'new'} ne $hiname) {
-          ($hidir  = $hifile_target) =~ s/([^\/]*\/)*.*\.$HiSuffix/$1/;
+          ($hidir  = $hifile_target) =~ s/(.*)$hiname\.$HiSuffix/$1/;
 	  $hifile_target = $hidir . $ModuleName{'new'} . ".$HiSuffix";
         }
     }
-- 
GitLab