Menu

#3 Offset handling (-b) considers files empty unless -s given

None
closed
nobody
None
5
2014-10-07
2010-10-15
Anonymous
No

When opening a file while only specifying an offset, I would expect bvi to read the full file starting from the given offset.

This isn't the case. The offset handling code within bvi doesn't read full files, but only the amount of bytes given via -s. -s isn't mandatory and defaults to 0. Thus, when ones specifies -b but not -s, bvi only triggers a 0 bytes read and upon receiving 0 bytes considers the file as empty. This specifically lends itself to breakage as the file will be truncated to 0 bytes when the user decides to save & exit.

Discussion

  • Gerhard Buergmann

    Fixed in 1.4.0

     
  • Gerhard Buergmann

    • status: open --> closed
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB