From fe09ef15aea46ec9424eb6d8acb95defb97620d5 Mon Sep 17 00:00:00 2001 From: jeffhappily Date: Mon, 17 Feb 2020 18:23:09 +0800 Subject: [PATCH] Remove trailing tabs Fix linter error --- src/unix/System/Terminal.hsc | 12 ++++++------ src/windows/System/Terminal.hs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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 diff --git a/src/windows/System/Terminal.hs b/src/windows/System/Terminal.hs index b8705b870b..c932d2af0d 100644 --- a/src/windows/System/Terminal.hs +++ b/src/windows/System/Terminal.hs @@ -67,7 +67,7 @@ getTerminalWidth = do [left,_top,right,_bottom] <- forM [0..3] $ \i -> do v <- peekByteOff p ((i*2) + posCONSOLE_SCREEN_BUFFER_INFO_srWindow) return $ fromIntegral (v :: Word16) - return $ Just $ (1+right-left) + return $ Just (1+right-left) -- | Set the code page for this process as necessary. Only applies to Windows. -- See: https://github.com/commercialhaskell/stack/issues/738