mike Tue Aug 8 15:53:54 2006 UTC
Modified files:
/php-src/ext/dbase dbase.c dbf_head.c
Log:
- implement #38357 (dbase_open can't open DBase 3 dbf file)
http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbase.c?r1=1.82&r2=1.83&diff_format=u
Index: php-src/ext/dbase/dbase.c
diff -u php-src/ext/dbase/dbase.c:1.82 php-src/ext/dbase/dbase.c:1.83
--- php-src/ext/dbase/dbase.c:1.82 Wed Jul 12 13:17:25 2006
+++ php-src/ext/dbase/dbase.c Tue Aug 8 15:53:54 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbase.c,v 1.82 2006/07/12 13:17:25 tony2001 Exp $ */
+/* $Id: dbase.c,v 1.83 2006/08/08 15:53:54 mike Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -490,6 +490,13 @@
}
}
break;
+ case 'F':
+ if (!assoc) {
+ add_next_index_double(return_value,
atof(str_value));
+ } else {
+ add_assoc_double(return_value,
cur_f->db_fname, atof(str_value));
+ }
+ break;
case 'L': /* we used to FALL THROUGH, but now we
check for T/Y and F/N
and insert 1 or 0,
respectively. db_fdc is the number of
decimals, which we don't
care about. 3/14/2001 LEW */
@@ -667,6 +674,9 @@
case 'D':
cur_f->db_flen = 8;
break;
+ case 'F':
+ cur_f->db_flen = 20;
+ break;
case 'N':
case 'C':
/* field length */
@@ -839,6 +849,7 @@
case 'N': add_assoc_string(row, "type", "number", 1);
break;
case 'L': add_assoc_string(row, "type", "boolean", 1);
break;
case 'M': add_assoc_string(row, "type", "memo", 1);
break;
+ case 'F': add_assoc_string(row, "type", "float", 1);
break;
default: add_assoc_string(row, "type", "unknown", 1);
break;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbf_head.c?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/dbase/dbf_head.c
diff -u php-src/ext/dbase/dbf_head.c:1.16 php-src/ext/dbase/dbf_head.c:1.17
--- php-src/ext/dbase/dbf_head.c:1.16 Thu May 25 11:46:12 2006
+++ php-src/ext/dbase/dbf_head.c Tue Aug 8 15:53:54 2006
@@ -148,6 +148,7 @@
dbf->db_type = dbfield.dbf_type;
switch (dbf->db_type) {
case 'N':
+ case 'F':
dbf->db_flen = dbfield.dbf_flen[0];
dbf->db_fdc = dbfield.dbf_flen[1];
break;
@@ -231,6 +232,7 @@
case 'N':
case 'L':
case 'D':
+ case 'F':
sprintf(format, "%%%ds", dbf->db_flen);
break;
case 'M':
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php