|
1 | 1 | {-# LANGUAGE CPP #-} |
2 | 2 | {-# LANGUAGE TypeApplications #-} |
3 | | -{-# LANGUAGE QuasiQuotes #-} |
4 | 3 | {-# LANGUAGE PackageImports #-} |
5 | 4 |
|
6 | 5 | module System.File.Platform where |
7 | 6 |
|
8 | 7 | import Control.Exception (bracketOnError, try, SomeException, onException) |
9 | 8 | import Data.Bits |
| 9 | +import Data.Maybe (fromJust) |
10 | 10 | import System.IO (IOMode(..), Handle) |
11 | 11 | import System.OsPath.Windows ( WindowsPath ) |
12 | 12 | import qualified System.OsPath.Windows as WS |
13 | 13 | import Foreign.C.Types |
14 | 14 |
|
15 | 15 | import qualified System.OsString.Windows as WS hiding (decodeFS) |
16 | | -import System.OsString.Windows ( pstr, WindowsString ) |
| 16 | +import System.OsString.Windows ( encodeUtf, WindowsString ) |
17 | 17 | import qualified System.Win32 as Win32 |
18 | 18 | import qualified System.Win32.WindowsString.File as WS |
19 | 19 | import System.Win32.WindowsString.Types (withTString, peekTString) |
@@ -160,7 +160,7 @@ findTempName :: (WindowsString, WindowsString) |
160 | 160 | findTempName (prefix, suffix) loc tmp_dir mode = go |
161 | 161 | where |
162 | 162 | go = do |
163 | | - let label = if prefix == mempty then [pstr|ghc|] else prefix |
| 163 | + let label = if prefix == mempty then fromJust (encodeUtf "ghc") else prefix |
164 | 164 | #if MIN_VERSION_Win32(2, 14, 0) |
165 | 165 | withFilePath tmp_dir $ \c_tmp_dir -> |
166 | 166 | #else |
|
0 commit comments