Skip to content

Commit

Permalink
Fix formatting absolute paths (#7560)
Browse files Browse the repository at this point in the history
Fixes #7559
  • Loading branch information
RX14 authored and straight-shoota committed Mar 17, 2019
1 parent f9fde1a commit d4ded5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compiler/crystal/command/format.cr
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class Crystal::Command
private def normalize_paths(paths)
path_start = ".#{File::SEPARATOR}"
paths.map do |path|
path = path_start + path unless path.starts_with?(path_start)
unless path.starts_with?(path_start) || path.starts_with?(File::SEPARATOR)
path = path_start + path
end
path.rstrip(File::SEPARATOR)
end
end
Expand Down

0 comments on commit d4ded5c

Please sign in to comment.