diff --git a/src/unix/System/Terminal.hsc b/src/unix/System/Terminal.hsc index b8ab1b52d2..e17b35ae5d 100644 --- a/src/unix/System/Terminal.hsc +++ b/src/unix/System/Terminal.hsc @@ -28,12 +28,12 @@ foreign import ccall "sys/ioctl.h ioctl" getTerminalWidth :: IO (Maybe Int) getTerminalWidth = - alloca $ \p -> do - errno <- ioctl (#const STDOUT_FILENO) (#const TIOCGWINSZ) p - if errno < 0 - then return Nothing - else do - WindowWidth w <- peek p + alloca $ \p -> do + errno <- ioctl (#const STDOUT_FILENO) (#const TIOCGWINSZ) p + if errno < 0 + then return Nothing + else do + WindowWidth w <- peek p return . Just . fromIntegral $ w fixCodePage :: x -> y -> a -> a