2002-10-25  Guerrero, Juan Manuel  <juan.guerrero@gmx.de>

	* Makefile.in: Remove BINOWN and BINGRP flags.
	  Add library libgdbm.la at link stage to binaries that need it.
	  Revert linking order of libraries to resolve unresolved references.
	  DOS filename restriction: gdbm.proto2 renamed to gdbm.pr2.
	  html and ps docs targets added.

	* dbm.h: Add structure tag to data structure. This inhibits
	  warning about anonymous struct using if g++ 2.95.2 is used.

	* gdbm.3: Typo fixed.
	  Add additional library linking info.

	* gdbm.proto: Add structure tag to data and GDBM_FILE structures.
	  This inhibits warning about anonymous struct using if g++ 2.95.2
	  is used.

	* gdbm.texinfo: Add additional library linking info.

	* gdbmreorg.c (gdbm_reorganize) (IS_DIR_SEPARTOR): DOS-style paths
	  may contain mixed slash, backslash and colon as directory separator.
	  (gdbm_reorganize) [O_BINARY]: close old and new database files before
	  renaming it.

	* gdbmsetopts.c (gdbm_setopt): The cases for GDBM_CENTFREE and
	  GDBM_COALESCEBLKS both set dbf->fast_write, which is an unrelated
	  flag, and do not set dbf->central_free or dbf->coalesce_blocks as
	  they should.

	* ndbm.h: Add structure tag to data and DBM structures. This inhibits
	  warning about anonymous struct using if g++ 2.95.2 is used.

	* systems.h [__DJGPP__]: DJGPP 2.03 implementation of fcntl() does
	  not support F_GETLK, F_SETLK nor F_SETLKW. Macros UNLOCK_FILE,
	  READLOCK_FILE and WRITELOCK_FILE will always return success.
	  [O_BINARY] (open): New macro. Open file in binary mode.
	  [O_BINARY] (IS_DIR_SEPARATOR): New macro. Check for DOS-style
	  dir separators.

	* testdbm.c: Include string.h for strlen() declaration.

	* testndbm.c: Include string.h for strlen() declaration.

	* version.h: Add DJGPP specific version string.



diff -aprNU5 gdbm-1.8.3.orig/Makefile.in gdbm-1.8.3/Makefile.in
--- gdbm-1.8.3.orig/Makefile.in	2002-10-08 16:09:12 +0000
+++ gdbm-1.8.3/Makefile.in	2006-04-29 17:27:22 +0000
@@ -18,10 +18,12 @@ INSTALL_DATA = @INSTALL_DATA@
 BINOWN = bin
 BINGRP = bin
 
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+DVIPS = dvips
 
 DEFS =
 
 # Where the system [n]dbm routines are...
 LIBS = @LIBS@ -lc
@@ -55,11 +57,11 @@ manext = 3
 .c.lo:
 	$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $<
 
 SHELL = /bin/sh
 
-PROGS = libgdbm.la testgdbm testdbm testndbm tndbm tdbm conv2gdbm
+PROGS = libgdbm.la testgdbm testdbm testndbm conv2gdbm #tndbm tdbm
 
 DBM_CF = dbminit.c delete.c fetch.c store.c seq.c close.c
 
 NDBM_CF = dbmopen.c dbmdelete.c dbmfetch.c dbmstore.c dbmseq.c \
 	dbmclose.c dbmdirfno.c dbmpagfno.c dbmrdonly.c
@@ -113,11 +115,11 @@ C_LOBJS = $(DBM_LOF) $(NDBM_LOF)
 
 HDRS = gdbmdefs.h extern.h gdbmerrno.h systems.h dbm.h ndbm.h gdbmconst.h \
 	proto.h
 
 MSCFILES = COPYING ChangeLog Makefile.in README gdbm.3 gdbm.texinfo \
-	gdbm.info NEWS INSTALL gdbm.proto gdbm.proto2 conv2gdbm.c \
+	gdbm.info NEWS INSTALL gdbm.proto gdbm.pr2 conv2gdbm.c \
 	configure configure.in getopt.c getopt.h samp1.cc \
 	autoconf.h.in install-sh mkinstalldirs config.guess config.sub \
 	aclocal.m4 ltconfig ltmain.sh
 
 DISTFILES = $(SRCS) $(HDRS) $(MSCFILES)
@@ -125,30 +127,25 @@ DISTFILES = $(SRCS) $(HDRS) $(MSCFILES)
 all: libgdbm.la libgdbm_compat.la
 
 progs: $(PROGS)
 
 install: libgdbm.la gdbm.h gdbm.info
-	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+	-$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
 		$(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
 		$(INSTALL_ROOT)$(infodir)
 	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
-		$(INSTALL_ROOT)$(includedir)/gdbm.h
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
-		$(INSTALL_ROOT)$(man3dir)/gdbm.3
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
-		$(INSTALL_ROOT)$(infodir)/gdbm.info
+	$(INSTALL_DATA) gdbm.h $(INSTALL_ROOT)$(includedir)/gdbm.h
+	$(INSTALL_DATA) $(srcdir)/gdbm.3 $(INSTALL_ROOT)$(man3dir)/gdbm.3
+	$(INSTALL_DATA) gdbm.info $(INSTALL_ROOT)$(infodir)/gdbm.info
 
 install-compat:
-	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+	-$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
 		$(INSTALL_ROOT)$(includedir)
 	$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
 		$(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
-		$(INSTALL_ROOT)$(includedir)/dbm.h
-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
-		$(INSTALL_ROOT)$(includedir)/ndbm.h
+	$(INSTALL_DATA) $(srcdir)/dbm.h  $(INSTALL_ROOT)$(includedir)/dbm.h
+	$(INSTALL_DATA) $(srcdir)/ndbm.h $(INSTALL_ROOT)$(includedir)/ndbm.h
 
 #libgdbm.a: $(OBJS) gdbm.h
 #	rm -f libgdbm.a
 #	ar q libgdbm.a $(OBJS)
 #	$(RANLIB) libgdbm.a
@@ -161,43 +158,43 @@ libgdbm.la: $(LOBJS) gdbm.h
 libgdbm_compat.la: $(C_LOBJS) gdbm.h
 	rm -f libgdbm_compat.la
 	$(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
 		-version-info $(SHLIB_VER) $(C_LOBJS)
 
-gdbm.h:	gdbm.proto gdbmerrno.h gdbm.proto2
+gdbm.h:	gdbm.proto gdbmerrno.h gdbm.pr2
 	rm -f gdbm.h
 	cp $(srcdir)/gdbm.proto gdbm.h
 	chmod +w gdbm.h
 	grep _ $(srcdir)/gdbmerrno.h >> gdbm.h
-	cat $(srcdir)/gdbm.proto2 >> gdbm.h
+	cat $(srcdir)/gdbm.pr2 >> gdbm.h
 	chmod -w gdbm.h
 
 testgdbm: testgdbm.o libgdbm.la @LIBOBJS@
 	$(LIBTOOL) $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
 
 testdbm: testdbm.o libgdbm.la libgdbm_compat.la
-	$(LIBTOOL) $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm.la libgdbm_compat.la
+	$(LIBTOOL) $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm_compat.la libgdbm.la
 
 tdbm: testdbm.o
 	$(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS)
 
 testndbm.o: testndbm.c
 	$(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c
 
 testndbm: testndbm.o libgdbm.la libgdbm_compat.la
-	$(LIBTOOL) $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.la libgdbm_compat.la
+	$(LIBTOOL) $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm_compat.la libgdbm.la
 
 tndbm.o: testndbm.c
 	cp $(srcdir)/testndbm.c ./tndbm.c
 	$(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) ./tndbm.c
 	rm -f ./tndbm.c
 
 tndbm: tndbm.o
 	$(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS)
 
-conv2gdbm: conv2gdbm.o libgdbm.la @LIBOBJS@
-	$(LIBTOOL) $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm.la @LIBOBJS@
+conv2gdbm: conv2gdbm.o libgdbm.la libgdbm_compat.la @LIBOBJS@
+	$(LIBTOOL) $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm_compat.la libgdbm.la @LIBOBJS@
 
 lintgdbm: 
 	lint $(DEFS) $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
 
 TAGS: $(SRCS)
@@ -211,12 +208,27 @@ gdbm.info: gdbm.texinfo
 dvi: gdbm.dvi
 
 gdbm.dvi: gdbm.texinfo
 	$(TEXI2DVI) $(srcdir)/gdbm.texinfo
 
+html: gdbm.html
+
+gdbm.html:
+	perl $(srcdir)/djgpp/texi2html -expandinfo -number -monolithic $(srcdir)/gdbm.texinfo
+
+ps: gdbm.ps
+
+gdbm.ps: dvi
+	$(DVIPS) gdbm.dvi -o gdbm.ps
+
+pdf: gdbm.pdf
+
+gdbm.pdf: gdbm.texinfo
+	$(TEXI2PDF) $(srcdir)/gdbm.texinfo
+
 clean:
-	rm -rf $(PROGS) $(TEX_F) *.a *.la *.o *.lo core *.core junk* \
+	rm -rf $(PROGS) $(TEX_F) *.exe *.a *.la *.o *.lo core *.core junk* \
 		.libs _libs
 
 mostlyclean: clean
 
 distclean: clean
diff -aprNU5 gdbm-1.8.3.orig/dbm.h gdbm-1.8.3/dbm.h
--- gdbm-1.8.3.orig/dbm.h	1999-05-19 00:16:04 +0000
+++ gdbm-1.8.3/dbm.h	2006-04-29 16:36:40 +0000
@@ -25,11 +25,11 @@
                 Bellingham, WA 98226
        
 *************************************************************************/
 
 /* The data and key structure.  This structure is defined for compatibility. */
-typedef struct {
+typedef struct __tag_datum {
 	char *dptr;
 	int   dsize;
       } datum;
 
 
diff -aprNU5 gdbm-1.8.3.orig/gdbm.3 gdbm-1.8.3/gdbm.3
--- gdbm-1.8.3.orig/gdbm.3	2002-10-15 22:00:48 +0000
+++ gdbm-1.8.3/gdbm.3	2006-04-29 16:36:40 +0000
@@ -282,11 +282,11 @@ writer - if database does not exist crea
 .br
 .B GDBM_NEWDB
 writer - create new database regardless if one exists
 .br
 For the last three (writers of the database) the following may be added
-added to \fIread_write\fR by bitwise or:
+to \fIread_write\fR by bitwise or:
 .B GDBM_SYNC,
 which causes all database operations to be synchronized to the disk, and
 .B GDBM_NOLOCK,
 which prevents the library from performing any locking on the database file.
 The option
@@ -539,11 +539,16 @@ parameter to the compile line, e.g.:
 	gcc -o prog prog.c -lgdbm
 
 If you wish to use the \fBdbm\fR or \fBndbm\fR compatibility routines,
 you must link in the \fIgdbm_compat\fR library as well.  For example:
 .sp
-	gcc -o prog proc.c -lgdbm -lgdbm_compat
+	gcc -o prog proc.c -lgdbm_compat -lgdbm
+
+Please note that the compatibility library contains references to
+gdbm routines so the order in which the libraries are linked is essential.
+This means that the library linking order given in the above example must
+be respected.
 
 .SH BUGS
 
 .SH "SEE ALSO"
 dbm, ndbm
diff -aprNU5 gdbm-1.8.3.orig/gdbm.proto gdbm-1.8.3/gdbm.proto
--- gdbm-1.8.3.orig/gdbm.proto	1999-05-19 00:16:06 +0000
+++ gdbm-1.8.3/gdbm.proto	2006-04-29 16:36:40 +0000
@@ -51,18 +51,18 @@
 #define  GDBM_SYNCMODE	3	/* Turn on or off sync operations. */
 #define  GDBM_CENTFREE  4	/* Keep all free blocks in the header. */
 #define  GDBM_COALESCEBLKS 5	/* Attempt to coalesce free blocks. */
 
 /* The data and key structure.  This structure is defined for compatibility. */
-typedef struct {
+typedef struct __tag_datum {
 	char *dptr;
 	int   dsize;
       } datum;
 
 
 /* The file information header. This is good enough for most applications. */
-typedef struct {int dummy[10];} *GDBM_FILE;
+typedef struct __tag_gdbm_file {int dummy[10];} *GDBM_FILE;
 
 /* Determine if the C(++) compiler requires complete function prototype  */
 #ifndef __P
 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
 #define __P(x) x
diff -aprNU5 gdbm-1.8.3.orig/gdbm.texinfo gdbm-1.8.3/gdbm.texinfo
--- gdbm-1.8.3.orig/gdbm.texinfo	2002-10-15 21:59:38 +0000
+++ gdbm-1.8.3/gdbm.texinfo	2006-04-29 16:36:40 +0000
@@ -710,13 +710,18 @@ int dbm_rdonly(file);
 
 If you want to compile an old C program that used UNIX @code{dbm} or @code{ndbm}
 and want to use @code{gdbm} files, execute the following @code{cc} command:
 
 @example
-cc ... -L/usr/local/lib -lgdbm -lgdbm_compat
+cc ... -L/usr/local/lib -lgdbm_compat -lgdbm
 @end example
 
+Please note that the compatibility library contains references to
+gdbm routines so the order in which the libraries are linked is essential.
+This means that the library linking order given in the above example must
+be respected.
+
 @node Conversion, Bugs, Compatibility, Top
 @chapter Converting @code{dbm} files to @code{gdbm} format.
 
 The program @code{conv2gdbm} has been provided to help you convert from @code{dbm}
 databases to @code{gdbm}. The usage is:
diff -aprNU5 gdbm-1.8.3.orig/gdbmreorg.c gdbm-1.8.3/gdbmreorg.c
--- gdbm-1.8.3.orig/gdbmreorg.c	2002-10-07 18:38:26 +0000
+++ gdbm-1.8.3/gdbmreorg.c	2006-04-29 16:36:40 +0000
@@ -101,11 +101,11 @@ gdbm_reorganize (dbf)
       return -1;
     }
   strcpy (&new_name[0], dbf->name);
   new_name[len+2] = 0;
   new_name[len+1] = '#';
-  while ( (len > 0) && new_name[len-1] != '/')
+  while ( (len > 0) && !IS_DIR_SEPARATOR(new_name[len-1]))
     {
       new_name[len] = new_name[len-1];
       len -= 1;
     }
   new_name[len] = '#';
@@ -161,10 +161,65 @@ gdbm_reorganize (dbf)
   gdbm_sync (new_dbf);
 
 
   /* Move the new file to old name. */
 
+#if O_BINARY
+
+  /* DOS can not rename an open file.
+     Both source and destination must be closed. */
+
+  {
+     char *dbf_name;
+     int dbf_block_size;
+     int dbf_flags;
+     void (*dbf_fatal) ();
+     int status;
+
+     gdbm_close (new_dbf);
+
+     dbf_name = (char *) malloc (strlen (dbf->name + 1));
+     if (dbf_name == NULL)
+       {
+         gdbm_errno = GDBM_REORGANIZE_FAILED;
+         free (new_name);
+         return -1;
+       }
+     strcpy (dbf_name, dbf->name);
+     dbf_block_size = dbf->header->block_size;
+     dbf_flags = GDBM_WRITER;
+     if (!(dbf->file_locking)) dbf_flags |= GDBM_NOLOCK;
+     if (!(dbf->fast_write))   dbf_flags |= GDBM_SYNC;
+     dbf_fatal = dbf->fatal_err;
+
+     gdbm_close (dbf);
+
+     status = rename (new_name, dbf_name);
+
+     /* Reorganized database will be opened with old file name. */
+     new_dbf = gdbm_open (dbf_name, dbf_block_size, dbf_flags,
+                          fileinfo.st_mode, dbf_fatal);
+     free (dbf_name);
+     if (new_dbf == NULL)
+       /* Database file can not be reopened.
+          Note that gdbm_errno != GDBM_REORGANIZE_FAILED now,
+          and hence the `dbf' is corrupt. */
+       status = -1;
+     else
+       {
+          /* if errno == GDBM_REORGANIZE_FAILED,
+             the caller still has a valid `dbf'. */
+          if (status != 0) gdbm_errno = GDBM_REORGANIZE_FAILED;
+          *dbf = *new_dbf;
+          free (new_dbf);
+       }
+
+     return status;  /* If status == 0 then renaming *and* reopening worked. */
+  }
+
+#else  /* not O_BINARY */
+
   if (rename (new_name, dbf->name) != 0)
     {
       gdbm_errno = GDBM_REORGANIZE_FAILED;
       gdbm_close (new_dbf);
       free (new_name);
@@ -213,6 +268,8 @@ gdbm_reorganize (dbf)
   /* Force the right stuff for a correct bucket cache. */
   dbf->cache_entry    = &dbf->bucket_cache[0];
   _gdbm_get_bucket (dbf, 0);
 
   return 0;
+
+#endif /* not O_BINARY */
 }
diff -aprNU5 gdbm-1.8.3.orig/gdbmsetopt.c gdbm-1.8.3/gdbmsetopt.c
--- gdbm-1.8.3.orig/gdbmsetopt.c	1999-05-19 00:16:06 +0000
+++ gdbm-1.8.3/gdbmsetopt.c	2006-04-29 16:36:40 +0000
@@ -86,22 +86,22 @@ gdbm_setopt(dbf, optflag, optval, optlen
 	  {
 	    gdbm_errno = GDBM_OPT_ILLEGAL;
 	    return(-1);
 	  }
 
-	dbf->fast_write = *optval;
+	dbf->central_free = *optval;
 	break;
 
       case GDBM_COALESCEBLKS:
       	/* Optval will point to either true or false. */
 	if ((*optval != TRUE) && (*optval != FALSE))
 	  {
 	    gdbm_errno = GDBM_OPT_ILLEGAL;
 	    return(-1);
 	  }
 
-	dbf->fast_write = *optval;
+	dbf->coalesce_blocks = *optval;
 	break;
 
       default:
         gdbm_errno = GDBM_OPT_ILLEGAL;
         return(-1);
diff -aprNU5 gdbm-1.8.3.orig/ndbm.h gdbm-1.8.3/ndbm.h
--- gdbm-1.8.3.orig/ndbm.h	1999-05-19 00:16:06 +0000
+++ gdbm-1.8.3/ndbm.h	2006-04-29 16:36:40 +0000
@@ -30,18 +30,18 @@
 #define  DBM_INSERT  0
 #define  DBM_REPLACE 1
 
 
 /* The data and key structure.  This structure is defined for compatibility. */
-typedef struct {
+typedef struct __tag_datum {
 	char *dptr;
 	int   dsize;
       } datum;
 
 
 /* The file information header. This is good enough for most applications. */
-typedef struct {int dummy[10];} DBM;
+typedef struct __tag_dbm {int dummy[10];} DBM;
 
 
 /* These are the routines (with some macros defining them!) */
 
 extern DBM 	*dbm_open ();
diff -aprNU5 gdbm-1.8.3.orig/systems.h gdbm-1.8.3/systems.h
--- gdbm-1.8.3.orig/systems.h	2002-10-07 18:44:30 +0000
+++ gdbm-1.8.3/systems.h	2006-04-29 17:41:22 +0000
@@ -85,10 +85,25 @@
 
 #else
 
 /* Assume it is done like System V. */
 
+#if __DJGPP__ && __DJGPP_MINOR__ < 4
+  /*
+     DJGPP 2.03 implementation of fcntl() does not support F_GETLK, F_SETLK
+     nor F_SETLKW. To make this package work, the macros below will *NEVER*
+     invoke fcntl() at all and *ALWAYS* return success.
+     All this means that READLOCK_FILE(dbf) and WRITELOCK_FILE(dbf)
+     will set lock_val = 0 simulating file locking/unlocking success
+     when there have been done **NO** file locking/unlocking at all.
+  */
+
+# define UNLOCK_FILE(dbf)    0
+# define READLOCK_FILE(dbf)  lock_val = 0; /* simulate success. */
+# define WRITELOCK_FILE(dbf) lock_val = 0; /* simulate success. */
+#else /* !__DJGPP__ || __DJGPP__ >= 2.04 */
+
 #define UNLOCK_FILE(dbf) \
 	{					\
 	  struct flock flock;			\
 	  flock.l_type = F_UNLCK;		\
 	  flock.l_whence = SEEK_SET;		\
@@ -109,10 +124,11 @@
 	  flock.l_type = F_WRLCK;		\
 	  flock.l_whence = SEEK_SET;			\
 	  flock.l_start = flock.l_len = 0L;	\
 	  lock_val = fcntl (dbf->desc, F_SETLK, &flock);	\
 	}
+#endif /* !__DJGPP__ || __DJGPP__ >= 2.04 */
 #endif
 
 /* Do we have bcopy?  */
 #if !HAVE_BCOPY
 #if HAVE_MEMORY_H
@@ -144,5 +160,20 @@
 #endif
 
 #ifndef STDERR_FILENO
 #define STDERR_FILENO 2
 #endif
+
+/* For systems that distinguish between text and binary I/O.
+   O_BINARY is usually declared in fcntl.h  */
+#if !defined O_BINARY && defined _O_BINARY
+  /* For MSC-compatible compilers.  */
+# define O_BINARY _O_BINARY
+#endif
+#if O_BINARY
+  /* Files must be opened in BINARY mode. */
+# define open(x, y, z)  open ((x), (y) | O_BINARY, (z))
+# define IS_DIR_SEPARATOR(c) ((c) == ':' || (c) == '/' || (c) == '\\')
+#else /* not O_BINARY */
+# define O_BINARY
+# define IS_DIR_SEPARATOR(c) ((c) == '/')
+#endif /* not O_BINARY */
diff -aprNU5 gdbm-1.8.3.orig/testdbm.c gdbm-1.8.3/testdbm.c
--- gdbm-1.8.3.orig/testdbm.c	2001-05-14 13:49:36 +0000
+++ gdbm-1.8.3/testdbm.c	2006-04-29 17:43:26 +0000
@@ -28,10 +28,11 @@
 
 
 /* include system configuration before all else. */
 #include "autoconf.h"
 
+#include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
 #if HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
diff -aprNU5 gdbm-1.8.3.orig/testndbm.c gdbm-1.8.3/testndbm.c
--- gdbm-1.8.3.orig/testndbm.c	2001-05-14 13:49:50 +0000
+++ gdbm-1.8.3/testndbm.c	2006-04-29 17:44:16 +0000
@@ -28,10 +28,11 @@
 
 
 /* include system configuration before all else. */
 #include "autoconf.h"
 
+#include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
 #if HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
diff -aprNU5 gdbm-1.8.3.orig/version.c gdbm-1.8.3/version.c
--- gdbm-1.8.3.orig/version.c	2002-10-15 22:00:42 +0000
+++ gdbm-1.8.3/version.c	2006-04-29 17:05:08 +0000
@@ -27,10 +27,10 @@
 *************************************************************************/
 
 #include "autoconf.h"
 
 /* Keep a string with the version number in it! */
-const char * gdbm_version = "GDBM version 1.8.3. 10/15/2002"
+const char * gdbm_version = "GDBM version 1.8.3. 10/15/2002 (DJGPP port 2006-04-29 (r2))"
 #if defined(__STDC__) && defined(__DATE__) && defined(__TIME__)
 		" (built " __DATE__ " " __TIME__ ")"
 #endif
 		;
