]> granicus.if.org Git - libvpx/commitdiff
tools/wrap-commit-msg.py: fix file truncation
authorJames Zern <jzern@google.com>
Fri, 30 Mar 2012 01:13:27 +0000 (18:13 -0700)
committerJames Zern <jzern@google.com>
Fri, 30 Mar 2012 01:13:27 +0000 (18:13 -0700)
truncate() operates from the current file pointer position. On at least
Linux specifying 0 without resetting the pointer will pad the file with
zeros to the current offset.

Change-Id: Ide704a1097f46c0c530f27212bb12e923f93e2d6

tools/wrap-commit-msg.py

index b53926ae13f420909a74e8e456ef1754d77cf537..d5b4b046b137f2a147b79c3d5525597a5f6ca884 100755 (executable)
@@ -59,6 +59,7 @@ def main(fileobj):
     if fileobj == sys.stdin:
         fileobj = sys.stdout
     else:
+        fileobj.seek(0)
         fileobj.truncate(0)
     fileobj.write(output)