ID: 6852 Updated by: vlad Reported By: [EMAIL PROTECTED] Old Status: Assigned Status: Closed Bug Type: dBase related Operating System: FreeBSD 4.0 PHP Version: 4.0.2 Assigned To: vlad New Comment:
... 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 Previous Comments: ------------------------------------------------------------------------ [2001-12-31 05:34:29] [EMAIL PROTECTED] 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... ------------------------------------------------------------------------ [2000-09-24 16:34:42] [EMAIL PROTECTED] 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 ------------------------------------------------------------------------ [2000-09-22 08:21:31] [EMAIL PROTECTED] //------------------------------------------------------ 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 ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=6852&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]