Permalink
Browse files

fix position/2 behavior to accept bof|cur|eof

  • Loading branch information...
1 parent 3b9e7a9 commit d5087abb93f71e3919d6776d4ec50caf8190494b @stolen stolen committed Nov 28, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/emmap.erl
View
@@ -101,6 +101,9 @@ pwrite_nif(_,_,_) ->
position(#file_descriptor{ module=?MODULE, data=Mem}, At)
when is_integer(At) ->
position_nif(Mem, bof, At);
+position(#file_descriptor{ module=?MODULE, data=Mem}, From)
+ when From == 'bof'; From == 'cur'; From == 'eof' ->
+ position_nif(Mem, From, 0);
position(#file_descriptor{ module=?MODULE, data=Mem}, {From, Off})
when From == 'bof'; From == 'cur'; From == 'eof' ->
position_nif(Mem, From, Off).

0 comments on commit d5087ab

Please sign in to comment.