From b2def40b3e9f66f139ecf070e1a829301e0fa772 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Thu, 4 Feb 1999 15:17:45 +0000
Subject: [PATCH] [project @ 1999-02-04 15:17:45 by sof] - Decode module names
 before outputting the .hi file

---
 ghc/driver/ghc-iface.lprl | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/ghc/driver/ghc-iface.lprl b/ghc/driver/ghc-iface.lprl
index 491b2af7f9cb..3fae1d10dd3a 100644
--- a/ghc/driver/ghc-iface.lprl
+++ b/ghc/driver/ghc-iface.lprl
@@ -121,13 +121,22 @@ sub constructNewHiFile {
 	  $new_hi,	    # Filename for new one
 	  $show_hi_diffs) = @_;
     local($hiname,$hidir);
-
+    local($mod_name_dec);
+    
     &readHiFile('new',$hsc_hi)	      unless $HiHasBeenRead{'new'} == 1;
+
+    # Sigh, we need decode the module name found in the interface file
+    # since that's the (base)name we want to use when outputting the
+    # interface file.
+    $mod_name_dec = $ModuleName{'new'};
+    $mod_name_dec =~ s/zz/z/g;
+    $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/;
-        if ($ModuleName{'new'} ne $hiname) {
+        if ( $mod_name_dec ne $hiname ) {
           ($hidir  = $hifile_target) =~ s/(.*)$hiname\.$HiSuffix/$1/;
-	  $hifile_target = $hidir . $ModuleName{'new'} . ".$HiSuffix";
+	  $hifile_target = $hidir . $mod_name_dec . ".$HiSuffix";
         }
     }
     &readHiFile('old',$hifile_target) unless $HiHasBeenRead{'old'} == 1;
-- 
GitLab