Index: configure
--- configure.orig	2006-10-25 14:42:31 +0200
+++ configure	2006-11-15 13:29:23 +0100
@@ -22650,9 +22650,7 @@
   LIBS="-ldl $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: dl library is required by SQLiteDBMS" >&5
-echo "$as_me: error: dl library is required by SQLiteDBMS" >&2;}
-   { (exit 1); exit 1; }; }
+    :
 fi
 
 echo "$as_me:$LINENO: checking for main in -lssl" >&5
@@ -22714,7 +22712,7 @@
 echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_main" >&5
 echo "${ECHO_T}$ac_cv_lib_ssl_main" >&6
 if test $ac_cv_lib_ssl_main = yes; then
-  CPPFLAGS="$CPPFLAGS -DENABLE_SSL" LIBS="$LIBS -lssl"
+  CPPFLAGS="$CPPFLAGS -DENABLE_SSL" LIBS="$LIBS -lssl -lcrypto"
 fi
 
 
Index: src/backend/Makefile.in
--- src/backend/Makefile.in.orig	2006-10-25 14:42:34 +0200
+++ src/backend/Makefile.in	2006-11-15 14:36:07 +0100
@@ -496,7 +496,7 @@
 install-data:
 	mkdir -p $(prefix)/data
 	mkdir -p $(prefix)/logs
-	mkdir -p $(prefix)/var/replication
+	mkdir -p $(prefix)/var/sqlitedbms/rep
 	touch $(prefix)/data/TEST
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
Index: src/backend/config.c
--- src/backend/config.c.orig	2006-11-09 08:23:53 +0100
+++ src/backend/config.c	2006-11-15 13:29:23 +0100
@@ -118,7 +118,7 @@
 		}
 	}
 
-	regcomp( &reg_node,	"([^=]*)\\s*=\\s*((\"[^\"]*\")|(.*))", REG_EXTENDED | REG_ICASE );
+	regcomp( &reg_node,	"([^=]*?)\\s*=\\s*((\"[^\"]*\")|(.*))", REG_EXTENDED | REG_ICASE );
 	while ( feof( conf ) == 0 && found > 0 )
 	{
 		fgets( line, 1024, conf );
@@ -132,7 +132,7 @@
 			//printf("(%lld, %lld, %lld, %lld, %lld, %lld, %lld, %lld, %lld, %lld)%s", node[0].rm_so, node[0].rm_eo, node[1].rm_so, node[1].rm_eo, node[2].rm_so, node[2].rm_eo, node[3].rm_so, node[3].rm_eo, node[4].rm_so, node[4].rm_eo, line);
 
 			set[set_len].buf = malloc( node[0].rm_eo+8 );
-			snprintf( set[set_len].buf, node[0].rm_eo, "%s", line );
+			snprintf( set[set_len].buf, node[0].rm_eo+1, "%s", line );
 
 			set[set_len].field = &(set[set_len].buf[0]);
 			set[set_len].buf[node[1].rm_eo] = '\0';
Index: src/backend/http.c
--- src/backend/http.c.orig	2006-11-09 07:43:35 +0100
+++ src/backend/http.c	2006-11-15 13:29:23 +0100
@@ -129,7 +129,7 @@
 		return -1;
 
 	gmtime_r( &time, &time_s );
-	return strftime( dst, 48, "%a, %d %b %G %H:%M:%S GMT", &time_s );
+	return strftime( dst, 48+1, "%a, %d %b %G %H:%M:%S GMT", &time_s );
 
 	dst[0] = '\0';
 
Index: src/backend/include/common.h
--- src/backend/include/common.h.orig	2006-11-09 07:43:49 +0100
+++ src/backend/include/common.h	2006-11-15 13:29:23 +0100
@@ -22,7 +22,7 @@
 #include <pthread.h>
 #include <getopt.h>
 #include <string.h>
-#include <regex.h>
+#include <pcreposix.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
Index: src/backend/libnetwork.c
--- src/backend/libnetwork.c.orig	2006-11-09 07:43:35 +0100
+++ src/backend/libnetwork.c	2006-11-15 13:29:23 +0100
@@ -193,7 +193,11 @@
 			return SQLITE_ERROR;
 
 		len = size - sended;
+#ifdef __FreeBSD__
+		res = sendfile( sock, filefd, offset, len, NULL, NULL, 0);
+#else
 		res = sendfile( sock, filefd, &offset, len );
+#endif
 		if ( res <= 0 )
 			return SQLITE_ERROR;
 		sended += res;
Index: src/backend/repl_master.c
--- src/backend/repl_master.c.orig	2006-11-09 09:10:51 +0100
+++ src/backend/repl_master.c	2006-11-15 14:34:57 +0100
@@ -9,7 +9,7 @@
 	FILE            *test;
 	char            filename[512];
 
-	snprintf( filename, 512, "var/replication/.init" );
+	snprintf( filename, 512, "var/sqlitedbms/rep/.init" );
 	test = fopen( filename, "w" );
 	if ( test == NULL )
 		return SQLITE_ERROR;
@@ -238,7 +238,7 @@
 		memset( file, 0, sizeof(struct repl_master_file_t) );
 
 		file->id = ++id;
-		snprintf( file->filename, 1024, "var/replication/binlog%d", file->id );
+		snprintf( file->filename, 1024, "var/sqlitedbms/rep/binlog%d", file->id );
 
 		file->file = fopen( file->filename, "w" );
 		file->offset = ftell( file->file );
Index: src/backend/response.c
--- src/backend/response.c.orig	2006-11-09 08:55:25 +0100
+++ src/backend/response.c	2006-11-15 13:29:23 +0100
@@ -101,7 +101,7 @@
 {
 	extern struct config_t	config;
 	int			len;
-	char			date_822[48];
+	char			date_822[48+1];
 	int			ret;
 
 	if ( self->response.header_sent != TRUE )
Index: src/lib/sqlited_internal.h
--- src/lib/sqlited_internal.h.orig	2006-11-10 11:02:17 +0100
+++ src/lib/sqlited_internal.h	2006-11-15 13:29:23 +0100
@@ -1,6 +1,10 @@
 #ifndef _SQLITED_INTERNAL_H_
 #define _SQLITED_INTERNAL_H_
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
 #define DEBUG			printf("----- DEBUG: %s: %d\n", __FILE__, __LINE__);
 #define	MAXVAL(x,y)		(x>y?x:y)
 #define	MINVAL(x,y)		(x<y?x:y)
