PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #6852 Misc. bugs
Submitted:22 Sep 2000 8:21am UTC Modified: 31 Dec 2001 7:57am UTC
From:kpeters at otaksoft dot com Assigned to:vlad
Status:Closed Category:dBase related
Version:4.0.2 OS:FreeBSD 4.0
View/Vote Developer Edit Submission

[22 Sep 2000 8:21am UTC] kpeters at otaksoft dot com
//------------------------------------------------------
Bug 1
//------------------------------------------------------
dbase.c, line 622 reads:

dbh->db_hlen = sizeof(struct dbf_dhead) + 2 + num_fields * sizeof(struct
dbf_dfield);

Should read:

dbh->db_hlen = sizeof(struct dbf_dhead) + 1 + num_fields * sizeof(struct
dbf_dfield);

Reason: There is only *one* header record terminator byte (0xD)

//------------------------------------------------------
Bug 2
//------------------------------------------------------
dbase.c, line 683 reads:

cur_f->db_flen = 9;

Should read:

cur_f->db_flen = 10;

Reason: Memo refs in Xbase are always of length 10 

//------------------------------------------------------
Bug 3
//------------------------------------------------------
dbase.c, line 288:

Code needs to be inserted below here that truncates the dbf file if
deleted records have been encountered, i.e. if rec_cnt <> new_cnt.

For this, pack_dbf would need to return a 'trunc_required'
flag. Code could also sit in dbf_rec.c function pack_dbf
[24 Sep 2000 4:34pm UTC] jmoore@php.net
Please do not report multiple bugs in one report, also please use the
short desc in the future, it is there for a reason, so that people can
see immediately what the bug is about. before posting another bug report
please read http://bugs.php.net/bugs-dos-and-donts.php.

Thanks anyway

James
[31 Dec 2001 5:34am UTC] vlad@php.net
Bug #1 is valid, though I know of applications that add add a null byte
there, just like php does. This seems to be relatively harmless, because
most of the apps are smart wnough to recognize that change, yet it is
not in the specs, so it got fixed. Scream if it breaks anything.

Bug #2 is valid, yet as of now there is really no support for .dbt files
anyway, so the only difference that would make is during creation of a
new dbf file. Fixed.

Bug #3 - I'm not sure to which revision of the file kpeters refers to,
definitely not line 288 anymore:( I need to look into what he meant.
Will do so tomorrow.

Assigning to self for now...
[31 Dec 2001 7:57am UTC] vlad@php.net
... and bug 3... you were using revision 1.30 for your line numbers :).
From looking at it... I am not sure what you are saying here. Do you
imply that we have to pack() the file before adding a new record? I do
not think so.

If you were talking about dbase_pack() not truncating the file, I fixed
it in dbf_rec.c

...closed

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC