Hugs only: no longer need backslash fiddle now that Hugs leaves them alone.
translate str = '\'' : foldr escape "'" str
where escape '\'' = showString "'\\''"
escape c = showChar c
translate str = '\'' : foldr escape "'" str
where escape '\'' = showString "'\\''"
escape c = showChar c
+#else /* mingw32_HOST_OS && ! __GLASGOW_HASKELL__ */
+# if __HUGS__
rawSystem cmd args = system (unwords (cmd : map translate args))
rawSystem cmd args = system (unwords (cmd : map translate args))
-
-translate :: String -> String
-translate str = '"' : foldr escape "\"" str
- where escape '"' = showString "\\\""
- escape '\\' = showString "\\\\"
- escape c = showChar c
-#else /* mingw32_HOST_OS && ! __GLASGOW_HASKELL__ && ! __HUGS__ */
rawSystem cmd args = system (unwords (map translate (cmd:args)))
rawSystem cmd args = system (unwords (map translate (cmd:args)))
-- copied from System.Process (qv)
translate :: String -> String
-- copied from System.Process (qv)
translate :: String -> String