Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility code #1148

Merged
merged 1 commit into from Dec 13, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 0 additions & 18 deletions Cabal/Distribution/Simple/InstallDirs.hs
Expand Up @@ -77,9 +77,7 @@ import Data.Maybe (fromMaybe)
import Data.Monoid (Monoid(..))
import System.Directory (getAppUserDataDirectory)
import System.FilePath ((</>), isPathSeparator, pathSeparator)
#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
import System.FilePath (dropDrive)
#endif

import Distribution.Package
( PackageIdentifier, packageName, packageVersion )
Expand Down Expand Up @@ -586,19 +584,3 @@ foreign import stdcall unsafe "shlobj.h SHGetFolderPathW"
-> CWString
-> IO CInt
#endif

#if !(__HUGS__ || __GLASGOW_HASKELL__ > 606)
-- Compat: this function only appears in FilePath > 1.0
-- (which at the time of writing is unreleased)
dropDrive :: FilePath -> FilePath
dropDrive (c:cs) | isPathSeparator c = cs
dropDrive (_:':':c:cs) | isWindows
&& isPathSeparator c = cs -- path with drive letter
dropDrive (_:':':cs) | isWindows = cs
dropDrive cs = cs

isWindows :: Bool
isWindows = case buildOS of
Windows -> True
_ -> False
#endif