2013-12-13  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* watt/src/getnet.c (): Return a NULL pointer if networkFile is a NULL pointer.


2013-12-10  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* watt/src/cpumodel.s: Code removed according a suggestion of Mikulas Patocka.
	See: http://www.bttr-software.de/forum/board_entry.php?id=12993#p12993.

	* watt/src/get_ai.c: Code moved to the beginning of the function according
	a suggestion of Mikulas Patocka.
	See: http://www.bttr-software.de/forum/board_entry.php?id=12993#p12993





diff -aprNU5 watt.r1/src/cpumodel.s watt/src/cpumodel.s
--- watt.r1/src/cpumodel.s	2005-12-29 16:10:34 +0000
+++ watt/src/cpumodel.s	2013-12-10 20:29:24 +0000
@@ -200,14 +200,22 @@ is486x:
 n6x86:
     setCx86 ($0xC3, %cx)    /* Restore old CCR3 */
     sti
 
 ncyrix:
+#if 0
+    /*
+     *  Juan M. Guerrero: 2013-12-10
+     *  Code removed according a suggestion of Mikulas Patocka
+     *  while porting Links to DOS using DJGPP.
+     *  See: http://www.bttr-software.de/forum/board_entry.php?id=12993#p12993
+     */
     popfl                   /* restore original EFLAGS */
     call check_x87
     popl %ebx
     jmp  end_CheckCpuType
+#endif
 
 is386:
     popfl                   /* restore original EFLAGS */
     call check_x87
 
diff -aprNU5 watt.r1/src/get_ai.c watt/src/get_ai.c
--- watt.r1/src/get_ai.c	2006-01-06 17:42:12 +0000
+++ watt/src/get_ai.c	2013-12-10 20:29:24 +0000
@@ -525,10 +525,23 @@ static int explore_fqdn (const struct ad
   struct hostent   *hp;
   struct addrinfo sentinel, *cur;
   int    error, af, i;
   char  *ap;
 
+#if 1
+  /*
+   *  Juan M. Guerrero: 2013-12-10
+   *  Code moved to the beginning of the function according
+   *  a suggestion of Mikulas Patocka while porting Links to
+   *  DOS using DJGPP.
+   *  See: http://www.bttr-software.de/forum/board_entry.php?id=12993#p12993
+   */
+  struct hostent copy;
+  struct in6_addr addr [MAX_ADDRESSES+1];
+  char           *list [MAX_ADDRESSES+1];
+#endif
+
 #ifdef TEST_PROG
   SOCK_DEBUGF (("\nexplore_fqdn"));
 #endif
 
   error = 0;
@@ -587,13 +600,22 @@ static int explore_fqdn (const struct ad
   /* Perform a shallow copy of 'hp'. Since 'hp' is returned from
    * fill_hostent(), the contents will be destroyed in below
    * get_name() otherwise.
    */
   {
+#if 0
+    /*
+     *  Juan M. Guerrero: 2013-12-10
+     *  Code removed according a suggestion of Mikulas Patocka
+     *  while porting Links to DOS using DJGPP.
+     *  Code moved to the beginning of the function.
+     *  See: http://www.bttr-software.de/forum/board_entry.php?id=12993#p12993
+     */
     struct hostent copy;
     struct in6_addr addr [MAX_ADDRESSES+1];
     char           *list [MAX_ADDRESSES+1];
+#endif
 
     copy = *hp;
     memset (&addr, 0, sizeof(addr));
     memset (&list, 0, sizeof(list));
     for (i = 0; hp->h_addr_list[i]; i++)
diff -aprNU5 watt.r1/src/getnet.c watt/src/getnet.c
--- watt.r1/src/getnet.c	2005-10-11 17:17:18 +0000
+++ watt/src/getnet.c	2013-12-12 14:18:56 +0000
@@ -177,11 +177,11 @@ struct netent * W32_CALL getnetent (void
   struct _netent n;
   char  *name, *net, *alias;
   char   buf [2*MAX_NAMELEN], *tok;
   int    i;
 
-  if (!netdb_init())
+  if (!netdb_init() || !networkFile)
      return (NULL);
 
   while (1)
   {
     if (!fgets(buf,sizeof(buf),networkFile))
