-
Notifications
You must be signed in to change notification settings - Fork 32
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
Implement getSearchPath #250
base: master
Are you sure you want to change the base?
Conversation
8106870
to
f88c411
Compare
@joeyh can you test this? |
The amount of code inlining here is outrageous. Maybe we need to implement this function somewhere else. |
|
||
-- | Get a list of 'FILEPATH's in the $PATH variable. | ||
getSearchPath :: IO [OsPath] | ||
#if defined(mingw32_HOST_OS) || defined(__MINGW32__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At line 1507 we checked whether WINDOWS is defined, presumably in our branch it isn't so is there any need to consider mingw32 platform here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this function will only be visible in the System.OsPath
module for the current platform. It will not be present in either System.OsPath.Posix
nor System.OsPath.Windows
.
Still it seems in such case it may be permissible for filepath
to depend on the Win32
package and reuse its environment handling functions.
@@ -1467,3 +1504,137 @@ decodeFS (OsString (PosixString x)) = decodeWithBasePosix x | |||
|
|||
#endif | |||
|
|||
#ifdef WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like sometimes it's checked as #ifdef WINDOWS
and other times the check looks like #if defined(WINDOWS)
. I suggest to unify everything to #if defined(WINDOWS)
style.
Fixes #249