diff -Naur child.c child.c
--- child.c	2003-10-26 11:10:13.000000000 +0100
+++ child.c	2011-01-04 10:07:18.000000000 +0100
@@ -40,13 +40,11 @@
 #endif /* HAVE_ERR_H */
 #include <errno.h>
 #include <fcntl.h>
-#ifdef HAVE_POLL_H
+#ifdef HAVE_POLL
 #include <poll.h>
-#elif HAVE_SYS_POLL_H
-#include <sys/poll.h>
 #else
-#include "poll.h"
-#endif /* HAVE_POLL_H || HAVE_SYS_POLL_H */
+#include "pollemu.h"
+#endif /* HAVE_POLL */
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -67,7 +65,7 @@
 
 #include "dcc.h"
 #include "io.h"
-#include "util.h"
+#include "strip_path.h"
 
 struct transfer_state {
     char *filename;
@@ -251,6 +249,7 @@
 	    if (lseek(out, offset, SEEK_SET) != offset) {
 		warn("error seeking to beginning -- giving up");
 		tell_client(fd, 151, NULL);
+		close(out);
 		return NULL;
 	    }
 	}
diff -Naur dccsend.c dccsend.c
--- dccsend.c	2003-10-29 23:44:52.000000000 +0100
+++ dccsend.c	2011-01-04 10:07:18.000000000 +0100
@@ -52,7 +52,7 @@
 #include "dccserver.h"
 #include "dcc.h"
 #include "io.h"
-#include "util.h"
+#include "strip_path.h"
 
 #ifndef HAVE_ERR
 void err(int, const char *, ...);
@@ -287,7 +287,7 @@
 usage(const char *prg)
 {
 
-    fprintf(stderr, "%s: send a file to a MIRC /dccserver\n\n"
+    fprintf(stderr, "%s: send a file to a mIRC /dccserver\n\n"
 	    "Usage:\n"
 	    "%s [-hv] [-n nickname] [-p port] [-r remotenick] host filename\n"
 	    "Where nickname is the own nick that should be used (default: 'dccserver'),\n"
diff -Naur dccserver.c dccserver.c
--- dccserver.c	2003-05-14 11:45:10.000000000 +0200
+++ dccserver.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: dccserver.c,v 1.63 2003/05/14 09:45:10 wiz Exp $ */
+/* $NiH: dccserver.c,v 1.64 2003/11/02 11:44:47 wiz Exp $ */
 /*-
  * Copyright (c) 2002, 2003 Thomas Klausner.
  * All rights reserved.
@@ -43,13 +43,11 @@
 #endif /* HAVE_ERR_H */
 #include <errno.h>
 #include <fcntl.h>
-#ifdef HAVE_POLL_H
+#ifdef HAVE_POLL
 #include <poll.h>
-#elif HAVE_SYS_POLL_H
-#include <sys/poll.h>
 #else
-#include "poll.h"
-#endif /* HAVE_POLL_H || HAVE_SYS_POLL_H */
+#include "pollemu.h"
+#endif /* HAVE_POLL */
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -224,7 +222,7 @@
 usage(const char *prg)
 {
 
-    fprintf(stderr, "%s: emulate mirc's /dccserver command\n\n"
+    fprintf(stderr, "%s: emulate mIRC's /dccserver command\n\n"
 	    "Usage:\n"
 	    "%s [-ehiv] [-n nickname] [-p port]\n"
 	    "Where port is the port on which %s should listen,\n"
diff -Naur dccserver.h dccserver.h
--- dccserver.h	2003-05-14 11:45:10.000000000 +0200
+++ dccserver.h	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: dccserver.h,v 1.6 2003/05/14 09:45:10 wiz Exp $ */
+/* $NiH: dccserver.h,v 1.5 2003/05/14 09:04:45 wiz Exp $ */
 /*-
  * Copyright (c) 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/dcc.c lib/dcc.c
--- lib/dcc.c	2003-10-22 17:15:11.000000000 +0200
+++ lib/dcc.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: dcc.c,v 1.3 2003/10/22 15:15:11 wiz Exp $ */
+/* $NiH: dcc.c,v 1.2 2003/05/25 00:33:34 wiz Exp $ */
 /*-
  * Copyright (c) 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/dcc.h lib/dcc.h
--- lib/dcc.h	2003-05-25 02:00:33.000000000 +0200
+++ lib/dcc.h	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: dcc.h,v 1.1 2003/05/25 00:00:33 wiz Exp $ */
+/* $NiH$ */
 /*-
  * Copyright (c) 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/err.c lib/err.c
--- lib/err.c	2003-05-11 04:38:58.000000000 +0200
+++ lib/err.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: err.c,v 1.2 2003/05/11 02:38:58 wiz Exp $ */
+/* $NiH: err.c,v 1.1 2002/10/15 18:41:11 wiz Exp $ */
 /*-
  * Copyright (c) 2002 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/errx.c lib/errx.c
--- lib/errx.c	2003-05-11 04:38:58.000000000 +0200
+++ lib/errx.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: errx.c,v 1.2 2003/05/11 02:38:58 wiz Exp $ */
+/* $NiH: errx.c,v 1.1 2003/04/04 12:29:38 wiz Exp $ */
 /*-
  * Copyright (c) 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/getaddrinfo.c lib/getaddrinfo.c
--- lib/getaddrinfo.c	2003-05-13 16:00:24.000000000 +0200
+++ lib/getaddrinfo.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: getaddrinfo.c,v 1.3 2003/05/13 14:00:24 wiz Exp $ */
+/* $NiH: getaddrinfo.c,v 1.2 2003/05/11 02:39:16 wiz Exp $ */
 /*-
  * getaddrinfo -- nodename-to-address translation in protocol-independent manner
  * Copyright (C) 2000, 2001 Dieter Baron.
diff -Naur lib/getaddrinfo.h lib/getaddrinfo.h
--- lib/getaddrinfo.h	2003-04-04 15:44:06.000000000 +0200
+++ lib/getaddrinfo.h	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: getaddrinfo.h,v 1.1 2003/04/04 13:44:06 wiz Exp $ */
+/* $NiH$ */
 /*-
  * getaddrinfo -- nodename-to-address translation in protocol-independent manner
  * Copyright (C) 2000, 2001 Dieter Baron.
diff -Naur lib/io.c lib/io.c
--- lib/io.c	2003-05-14 11:45:11.000000000 +0200
+++ lib/io.c	2011-01-04 10:07:18.000000000 +0100
@@ -37,13 +37,11 @@
 #include <err.h>
 #endif
 #include <errno.h>
-#ifdef HAVE_POLL_H
+#ifdef HAVE_POLL
 #include <poll.h>
-#elif HAVE_SYS_POLL_H
-#include <sys/poll.h>
 #else
-#include "poll.h"
-#endif /* HAVE_POLL_H || HAVE_SYS_POLL_H */
+#include "pollemu.h"
+#endif /* HAVE_POLL */
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
diff -Naur lib/io.h lib/io.h
--- lib/io.h	2003-10-23 12:25:01.000000000 +0200
+++ lib/io.h	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: io.h,v 1.4 2003/10/23 10:25:01 wiz Exp $ */
+/* $NiH: io.h,v 1.3 2003/05/14 09:45:11 wiz Exp $ */
 /*-
  * Copyright (c) 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/poll.c lib/poll.c
--- lib/poll.c	2003-05-12 23:33:32.000000000 +0200
+++ lib/poll.c	2011-01-04 10:07:18.000000000 +0100
@@ -76,7 +76,7 @@
 #include <sys/time.h>                        /* time definitions */
 #include <assert.h>                          /* assertion macros */
 #include <string.h>                          /* string functions */
-#include "poll.h"                            /* this package */
+#include "pollemu.h"                            /* this package */
 
 /*---------------------------------------------------------------------------*\
 				  Macros
diff -Naur lib/pollemu.h lib/pollemu.h
--- lib/pollemu.h	1970-01-01 01:00:00.000000000 +0100
+++ lib/pollemu.h	2011-01-04 10:07:18.000000000 +0100
@@ -0,0 +1,101 @@
+/*---------------------------------------------------------------------------*\
+  $Id: poll.h,v 1.1 2003/05/12 21:33:32 wiz Exp $
+
+  NAME
+
+	poll - select(2)-based poll() emulation function for BSD systems.
+
+  SYNOPSIS
+	#include "pollemu.h"
+
+	struct pollfd
+	{
+	    int     fd;
+	    short   events;
+	    short   revents;
+	}
+
+	int poll (struct pollfd *pArray, unsigned long n_fds, int timeout)
+
+  DESCRIPTION
+
+	This file, and the accompanying "poll.c", implement the System V
+	poll(2) system call for BSD systems (which typically do not provide
+	poll()).  Poll() provides a method for multiplexing input and output
+	on multiple open file descriptors; in traditional BSD systems, that
+	capability is provided by select().  While the semantics of select()
+	differ from those of poll(), poll() can be readily emulated in terms
+	of select() -- which is how this function is implemented.
+
+  REFERENCES
+	Stevens, W. Richard. Unix Network Programming.  Prentice-Hall, 1990.
+
+  NOTES
+	1. This software requires an ANSI C compiler.
+
+  LICENSE
+
+	This software is released under the following license:
+
+		Copyright (c) 1995-2002 Brian M. Clapper
+		All rights reserved.
+
+		Redistribution and use in source and binary forms are
+		permitted provided that: (1) source distributions retain
+		this entire copyright notice and comment; (2) modifications
+		made to the software are prominently mentioned, and a copy
+		of the original software (or a pointer to its location) are
+		included; and (3) distributions including binaries display
+		the following acknowledgement: "This product includes
+		software developed by Brian M. Clapper <bmc@clapper.org>"
+		in the documentation or other materials provided with the
+		distribution. The name of the author may not be used to
+		endorse or promote products derived from this software
+		without specific prior written permission.
+
+		THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
+		OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
+		IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+		PARTICULAR PURPOSE.
+
+	Effectively, this means you can do what you want with the software
+	except remove this notice or take advantage of the author's name.
+	If you modify the software and redistribute your modified version,
+	you must indicate that your version is a modification of the
+	original, and you must provide either a pointer to or a copy of the
+	original.
+\*---------------------------------------------------------------------------*/
+
+#ifndef _POLL_EMUL_H_
+#define _POLL_EMUL_H_
+
+#define POLLIN		0x01
+#define POLLPRI		0x02
+#define POLLOUT		0x04
+#define POLLERR		0x08
+#define POLLHUP		0x10
+#define POLLNVAL	0x20
+
+struct pollfd
+{
+    int     fd;
+    short   events;
+    short   revents;
+};
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#if (__STDC__ > 0) || defined(__cplusplus)
+extern int poll (struct pollfd *pArray, unsigned long n_fds, int timeout);
+#else
+extern int poll();
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _POLL_EMUL_H_ */
diff -Naur lib/strip_path.c lib/strip_path.c
--- lib/strip_path.c	1970-01-01 01:00:00.000000000 +0100
+++ lib/strip_path.c	2011-01-04 10:07:18.000000000 +0100
@@ -0,0 +1,50 @@
+/* $NiH$ */
+/*-
+ * Copyright (c) 2003 Thomas Klausner.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THOMAS KLAUSNER ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "strip_path.h"
+
+/* some fserves incorrectly include the complete path -- */
+/* strip it off */
+char *
+strip_path(char *p)
+{
+    char *q;
+
+    if ((q=strrchr(p, '/')) != NULL)
+	p = ++q;
+    if ((q=strrchr(p, '\\')) != NULL)
+	p = ++q;
+
+    return p;
+}
+
diff -Naur lib/strip_path.h lib/strip_path.h
--- lib/strip_path.h	1970-01-01 01:00:00.000000000 +0100
+++ lib/strip_path.h	2011-01-04 10:07:18.000000000 +0100
@@ -0,0 +1,32 @@
+/* $NiH$ */
+/*-
+ * Copyright (c) 2003 Thomas Klausner.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials provided
+ *    with the distribution. 
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.  
+ *
+ * THIS SOFTWARE IS PROVIDED BY THOMAS KLAUSNER ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+char *strip_path(char *);
diff -Naur lib/strlcpy.c lib/strlcpy.c
--- lib/strlcpy.c	2003-04-15 15:23:11.000000000 +0200
+++ lib/strlcpy.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: strlcpy.c,v 1.4 2003/04/15 13:23:11 wiz Exp $ */
+/* $NiH: strlcpy.c,v 1.3 2002/12/02 14:22:28 wiz Exp $ */
 /*	$NetBSD: strlcpy.c,v 1.12 2002/04/24 17:45:15 bjh21 Exp $	*/
 /*	$OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $	*/
 
diff -Naur lib/warn.c lib/warn.c
--- lib/warn.c	2002-10-15 20:41:11.000000000 +0200
+++ lib/warn.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: warn.c,v 1.1 2002/10/15 18:41:11 wiz Exp $ */
+/* $NiH$ */
 /*-
  * Copyright (c) 2002 Thomas Klausner.
  * All rights reserved.
diff -Naur lib/warnx.c lib/warnx.c
--- lib/warnx.c	2003-04-04 14:27:16.000000000 +0200
+++ lib/warnx.c	2011-01-04 10:07:18.000000000 +0100
@@ -1,4 +1,4 @@
-/* $NiH: warnx.c,v 1.2 2003/04/04 12:27:16 wiz Exp $ */
+/* $NiH: warnx.c,v 1.1 2002/10/15 18:41:11 wiz Exp $ */
 /*-
  * Copyright (c) 2002, 2003 Thomas Klausner.
  * All rights reserved.
diff -Naur socklen_t.c socklen_t.c
--- socklen_t.c	1970-01-01 01:00:00.000000000 +0100
+++ socklen_t.c	2011-01-04 10:07:18.000000000 +0100
@@ -0,0 +1,11 @@
+/* $NiH$ */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main()
+{
+    socklen_t *foo;
+
+    foo = 0;
+    return 0;
+}
diff -Naur stamp-h1 stamp-h1
--- stamp-h1	1970-01-01 01:00:00.000000000 +0100
+++ stamp-h1	2011-08-15 20:40:21.000000000 +0200
@@ -0,0 +1 @@
+timestamp for config.h
