From a861c3837650d751b638ba853e7b68ffff4acea1 Mon Sep 17 00:00:00 2001 From: mi Date: Fri, 16 Apr 2004 19:49:52 +0000 Subject: Update from 0.8.1 to 0.8.3. Fix bugs... --- databases/dbf/Makefile | 5 ++- databases/dbf/distinfo | 4 +- databases/dbf/files/patch-dbf.c | 60 +++++++++++++++++++-------- databases/dbf/files/patch-statistic | 82 +++++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 21 deletions(-) create mode 100644 databases/dbf/files/patch-statistic (limited to 'databases/dbf') diff --git a/databases/dbf/Makefile b/databases/dbf/Makefile index e2bed25f60cd..5e488a839e35 100644 --- a/databases/dbf/Makefile +++ b/databases/dbf/Makefile @@ -7,9 +7,10 @@ # PORTNAME= dbf -PORTVERSION= 0.8.1 +PORTVERSION= 0.8.3 CATEGORIES= databases -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITES= http://download.berlios.de/dbf/ \ + ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} DISTNAME= ${PORTNAME}-${PORTVERSION}.src diff --git a/databases/dbf/distinfo b/databases/dbf/distinfo index 7d5dd9d093f0..faf65c535916 100644 --- a/databases/dbf/distinfo +++ b/databases/dbf/distinfo @@ -1,2 +1,2 @@ -MD5 (dbf-0.8.1.src.tar.gz) = 21ed7b9a2f1369776de8131b64a8039d -SIZE (dbf-0.8.1.src.tar.gz) = 26217 +MD5 (dbf-0.8.3.src.tar.gz) = e12b56f007566294e76235c8b0890135 +SIZE (dbf-0.8.3.src.tar.gz) = 26057 diff --git a/databases/dbf/files/patch-dbf.c b/databases/dbf/files/patch-dbf.c index 4a9c1f003094..2f78adce4eb5 100644 --- a/databases/dbf/files/patch-dbf.c +++ b/databases/dbf/files/patch-dbf.c @@ -1,6 +1,20 @@ ---- dbf.c.orig Thu Nov 20 05:22:03 2003 -+++ dbf.c Fri Apr 2 17:01:43 2004 -@@ -341,7 +341,7 @@ +--- dbf.c Fri Apr 16 08:17:22 2004 ++++ dbf.c Fri Apr 16 15:31:29 2004 +@@ -245,11 +245,11 @@ + int dbfhandle; + FILE *output = NULL; + int header_length, record_length, i; +- const char *filename, *export_filename; ++ const char *filename, *export_filename = NULL; + headerMethod writeHeader = NULL; + lineMethod writeLine = printDBF; + unsigned char *record; +- char *flag_byte; ++ char flag_byte; + + if (argc < 2) { + fprintf(stderr, "Usage: %s [option][argument] dbf-file, -h for help\n", *argv); +@@ -342,7 +342,7 @@ if (verbosity > 0) banner(); @@ -9,19 +23,31 @@ output = stdout; else output = export_open(export_filename); -@@ -357,6 +357,7 @@ - exit(1); - - if (writeLine) { -+ char *flag_byte; - if ((record = malloc(record_length + 1)) == NULL) { - perror("malloc"); exit(1); - } -@@ -369,7 +370,6 @@ - //lseek(dbfhandle, rotate2b(db->header_length) + 1, SEEK_SET); - - /* At this point we look if the following data set is deleted */ -- char *flag_byte; +@@ -372,12 +372,7 @@ + /* At this point we look if the following data set is deleted */ lseek(dbfhandle, rotate2b(db->header_length), SEEK_SET); - if ( (flag_byte = malloc(1)) == NULL ) { +- if ( (flag_byte = malloc(1)) == NULL ) { +- perror("malloc"); +- exit(1); +- } +- +- if ( -1 == read(dbfhandle, flag_byte, 1) ) { ++ if ( -1 == read(dbfhandle, &flag_byte, 1) ) { + perror("reading Flag Byte"); + exit(1); + } +@@ -389,11 +384,11 @@ + exit(1); + } + +- if (*flag_byte == '*' && keep_deleted == 0) { ++ if (flag_byte == '*' && keep_deleted == 0) { + fputc('#', output); + } + +- *flag_byte = *(record + record_length - 1); ++ flag_byte = *(record + record_length - 1); + + /* automaticly convert options */ + if (convert) diff --git a/databases/dbf/files/patch-statistic b/databases/dbf/files/patch-statistic new file mode 100644 index 000000000000..81ab78605626 --- /dev/null +++ b/databases/dbf/files/patch-statistic @@ -0,0 +1,82 @@ +--- statistic.h Fri Apr 16 07:36:47 2004 ++++ statistic.h Fri Apr 16 15:42:21 2004 +@@ -15,5 +15,4 @@ + #include "endian.h" + +-char *get_db_version (int version); + void dbf_file_info (const struct DB_HEADER *db); + void dbf_field_stat (const struct DB_FIELD *header, int header_length); +--- statistic.c Fri Apr 16 07:36:47 2004 ++++ statistic.c Fri Apr 16 15:40:47 2004 +@@ -15,43 +15,37 @@ + #include "dbf.h" + + +-char *get_db_version (int version) { +- char *name; ++static const char * ++get_db_version (int version) { ++ static char name[31]; + + switch (version) { +- case 0x02: +- // without memo fields +- name = "FoxBase"; +- break; +- case 0x03: +- // without memo fields +- name = "FoxBase+/dBASE III+"; +- break; +- case 0x04: +- // without memo fields +- name = "dBASE IV"; +- break; +- case 0x05: +- // without memo fields +- name = "dBASE 5.0"; +- break; +- case 0x83: +- name = "FoxBase+/dBASE III+"; +- break; +- case 0x8B: +- name = "dBASE IV"; +- break; +- case 0x30: +- // without memo fields +- name = "Visual FoxPro"; +- break; +- case 0xF5: +- // with memo fields +- name = "FoxPro 2.0"; +- break; ++ case 0x02: ++ // without memo fields ++ return "FoxBase"; ++ case 0x03: ++ // without memo fields ++ return "FoxBase+/dBASE III+"; ++ case 0x04: ++ // without memo fields ++ return "dBASE IV"; ++ case 0x05: ++ // without memo fields ++ return "dBASE 5.0"; ++ case 0x83: ++ return "FoxBase+/dBASE III+"; ++ case 0x8B: ++ return "dBASE IV"; ++ case 0x30: ++ // without memo fields ++ return "Visual FoxPro"; ++ case 0xF5: ++ // with memo fields ++ return "FoxPro 2.0"; ++ default: ++ sprintf(name, "Unknown (code 0x%.2X)", version); ++ return name; + } +- +- return name; + } + + -- cgit