packages feed

FindBin 0.0.2 → 0.0.3

raw patch · 2 files changed

+11/−7 lines, 2 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

FindBin.cabal view
@@ -1,7 +1,7 @@ name:               FindBin-version:            0.0.2-copyright:          2008-2009 Audrey Tang-homepage:           http://github.com/audreyt/findbin+version:            0.0.3+copyright:          2008-2011 Audrey Tang+homepage:           https://github.com/audreyt/findbin license:            BSD3 license-file:       LICENSE author:             Audrey Tang <audreyt@audreyt.org>@@ -15,9 +15,9 @@ build-type:         Simple extensions:         ForeignFunctionInterface exposed-modules:    System.Environment.FindBin-build-depends:      base, directory, filepath+build-depends:      base < 5, directory, filepath extra-source-files: README hs-source-dirs:     src category:           System-tested-with:        GHC==6.8.2, GHC==6.8.3, GHC==6.10.1+tested-with:        GHC==6.8.2, GHC==6.8.3, GHC==6.10.1, GHC==7.0.1 ghc-options:        -Wall
src/System/Environment/FindBin.hs view
@@ -8,7 +8,7 @@ import Foreign (Ptr, alloca, peek, peekElemOff) import Foreign.C (CInt, CString, peekCString) import System.Directory (canonicalizePath, findExecutable)-import System.FilePath (takeDirectory)+import System.FilePath (takeDirectory, takeBaseName) import System.IO.Unsafe (unsafePerformIO)  {-# NOINLINE __Bin__ #-}@@ -41,7 +41,11 @@                     getFullProgArgv p_argc' p_argv'                     argc'   <- peek p_argc'                     argv'   <- peek p_argv'-                    s'      <- peekCString =<< peekElemOff argv' (fromEnum argc'-1)+                    prog    <- peekCString =<< peekElemOff argv' 0+                    s'      <- case (takeBaseName prog) of+                        "runghc" -> peekCString =<< peekElemOff argv' (fromEnum argc'-1)+                        "runhaskell" -> peekCString =<< peekElemOff argv' (fromEnum argc'-1)+                        _ -> return prog                     canon   <- canonicalizePath s                     canon'  <- canonicalizePath s'                     if canon == canon'