Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
c9b6b5e8
Commit
c9b6b5e8
authored
Jan 16, 2008
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix slash direction on Windows with the new filePath code
parent
04786494
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
compiler/main/DriverPipeline.hs
compiler/main/DriverPipeline.hs
+14
-9
compiler/utils/Util.lhs
compiler/utils/Util.lhs
+14
-0
No files found.
compiler/main/DriverPipeline.hs
View file @
c9b6b5e8
...
...
@@ -582,17 +582,22 @@ runPhase :: Phase -- Do this phase first
-- Unlit phase
runPhase
(
Unlit
sf
)
_stop
dflags
_basename
_suff
input_fn
get_output_fn
maybe_loc
=
do
let
unlit_flags
=
getOpts
dflags
opt_L
-- The -h option passes the file name for unlit to put in a #line directive
=
do
output_fn
<-
get_output_fn
dflags
(
Cpp
sf
)
maybe_loc
SysTools
.
runUnlit
dflags
(
map
SysTools
.
Option
unlit_flags
++
[
SysTools
.
Option
"-h"
,
SysTools
.
Option
input_fn
,
SysTools
.
FileOption
""
input_fn
,
SysTools
.
FileOption
""
output_fn
])
let
unlit_flags
=
getOpts
dflags
opt_L
flags
=
map
SysTools
.
Option
unlit_flags
++
[
-- The -h option passes the file name for unlit to
-- put in a #line directive
SysTools
.
Option
"-h"
-- cpp interprets \b etc as escape sequences,
-- so we use / for filenames in pragmas
,
SysTools
.
Option
$
reslash
Forwards
$
normalise
input_fn
,
SysTools
.
FileOption
""
input_fn
,
SysTools
.
FileOption
""
output_fn
]
SysTools
.
runUnlit
dflags
flags
return
(
Cpp
sf
,
dflags
,
maybe_loc
,
output_fn
)
...
...
compiler/utils/Util.lhs
View file @
c9b6b5e8
...
...
@@ -70,6 +70,7 @@ module Util (
splitLongestPrefix,
escapeSpaces,
parseSearchPath,
Direction(..), reslash,
) where
-- XXX This define is a bit of a hack, and should be done more nicely
...
...
@@ -841,4 +842,17 @@ searchPathSeparator = ';'
#else
searchPathSeparator = ':'
#endif
data Direction = Forwards | Backwards
reslash :: Direction -> FilePath -> FilePath
reslash d = f
where f ('/' : xs) = slash : f xs
f ('\\' : xs) = slash : f xs
f (x : xs) = x : f xs
f "" = ""
slash = case d of
Forwards -> '/'
Backwards -> '\\'
\end{code}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment