Browse files

hex_file: normalize file line endings

  • Loading branch information...
1 parent 77dc1ef commit 56079db69b710efeb6471a57aa3e44ff16254759 @msantos committed Feb 9, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/stk500.erl
View
5 src/stk500.erl
@@ -171,8 +171,9 @@ hex_file(File) ->
hex_file(intel, File).
hex_file(intel, File) ->
- {ok, Bin} = file:read_file(File),
- Hex = binary:split(Bin, <<"\r\n">>, [global, trim]),
+ {ok, Bin0} = file:read_file(File),
+ Bin = binary:replace(Bin0, <<"\r\n">>, <<"\n">>, [global]),
+ Hex = binary:split(Bin, <<"\n">>, [global, trim]),
rec(Hex).

0 comments on commit 56079db

Please sign in to comment.