Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit d5087abb93f71e3919d6776d4ec50caf8190494b 1 parent 3b9e7a9
Danil Zagoskin authored November 28, 2012

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  src/emmap.erl
3  src/emmap.erl
@@ -101,6 +101,9 @@ pwrite_nif(_,_,_) ->
101 101
 position(#file_descriptor{ module=?MODULE, data=Mem}, At)
102 102
   when is_integer(At) ->
103 103
     position_nif(Mem, bof, At);
  104
+position(#file_descriptor{ module=?MODULE, data=Mem}, From)
  105
+  when From == 'bof'; From == 'cur'; From == 'eof' ->
  106
+    position_nif(Mem, From, 0);
104 107
 position(#file_descriptor{ module=?MODULE, data=Mem}, {From, Off})
105 108
   when From == 'bof'; From == 'cur'; From == 'eof' ->
106 109
     position_nif(Mem, From, Off).

0 notes on commit d5087ab

Please sign in to comment.
Something went wrong with that request. Please try again.