From d524cf57d88a447813a2017139f2515f79c4a295 Mon Sep 17 00:00:00 2001
From: "Malcolm.Wallace@cs.york.ac.uk" <unknown>
Date: Tue, 27 May 2008 09:52:20 +0000
Subject: [PATCH] fix to build with nhc98 (old 1.0 interface only)

---
 System/Cmd.hs     | 16 ++++++++++++++++
 System/Process.hs |  2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/System/Cmd.hs b/System/Cmd.hs
index 9ae00589..5fba0646 100644
--- a/System/Cmd.hs
+++ b/System/Cmd.hs
@@ -22,4 +22,20 @@ module System.Cmd
       rawSystem,     -- :: FilePath -> [String] -> IO ExitCode
     ) where
 
+#ifndef __NHC__
 import System.Process
+#else
+import System
+
+rawSystem :: String -> [String] -> IO ExitCode
+rawSystem cmd args = system (unwords (map translate (cmd:args)))
+
+-- copied from System.Process (qv)
+translate :: String -> String
+translate str = '"' : snd (foldr escape (True,"\"") str)
+  where escape '"'  (b,     str) = (True,  '\\' : '"'  : str)
+        escape '\\' (True,  str) = (True,  '\\' : '\\' : str)
+        escape '\\' (False, str) = (False, '\\' : str)
+        escape c    (b,     str) = (False, c : str)
+
+#endif
diff --git a/System/Process.hs b/System/Process.hs
index a9ef332d..fd0dd193 100644
--- a/System/Process.hs
+++ b/System/Process.hs
@@ -7,7 +7,7 @@
 --
 -- Maintainer  :  libraries@haskell.org
 -- Stability   :  experimental
--- Portability :  portable
+-- Portability :  non-portable (requires concurrency)
 --
 -- Operations for creating and interacting with sub-processes.
 --
-- 
GitLab