diff options
author | rsc <devnull@localhost> | 2005-07-24 20:15:44 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-07-24 20:15:44 +0000 |
commit | 23fb2edb22703ad10aae02295e654b3de68617c5 (patch) | |
tree | 68033bae1131e4028eb4a78d4cc028bd2c77839d /src/libventi/entry.c | |
parent | 7ba8aa0c7083415ad69c2f8e591425f3c6ebf952 (diff) | |
download | plan9port-23fb2edb22703ad10aae02295e654b3de68617c5.tar.gz plan9port-23fb2edb22703ad10aae02295e654b3de68617c5.tar.bz2 plan9port-23fb2edb22703ad10aae02295e654b3de68617c5.zip |
venti updates
Diffstat (limited to 'src/libventi/entry.c')
-rw-r--r-- | src/libventi/entry.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libventi/entry.c b/src/libventi/entry.c index ca1d2009..aeb8dada 100644 --- a/src/libventi/entry.c +++ b/src/libventi/entry.c @@ -7,7 +7,7 @@ static int checksize(int n) { if(n < 256 || n > VtMaxLumpSize) { - werrstr("bad block size"); + werrstr("bad block size %#ux", n); return -1; } return 0; @@ -77,6 +77,16 @@ vtentryunpack(VtEntry *e, uchar *p, int index) if(!(e->flags & VtEntryActive)) return 0; + /* + * Some old vac files use psize==0 and dsize==0 when the + * file itself has size 0 or is zeros. Just to make programs not + * have to figure out what block sizes of 0 means, rewrite them. + */ + if(e->psize == 0 && e->dsize == 0 + && memcmp(e->score, vtzeroscore, VtScoreSize) == 0){ + e->psize = 4096; + e->dsize = 4096; + } if(checksize(e->psize) < 0 || checksize(e->dsize) < 0) return -1; |