diff -uN wget-1.5.3/src/ftp.c wget-1.5.3-os2/src/ftp.c
--- wget-1.5.3/src/ftp.c	Thu Sep 10 12:21:36 1998
+++ wget-1.5.3-os2/src/ftp.c	Wed Sep 23 01:49:54 1998
@@ -899,6 +899,9 @@
 #ifdef WINDOWS
 	  ws_changetitle (hurl, 1);
 #endif
+#ifdef __EMX__
+	  os2title(0, hurl);
+#endif
 	  free (hurl);
 	}
       /* Send getftp the proper length, if fileinfo was provided.  */
diff -uN wget-1.5.3/src/http.c wget-1.5.3-os2/src/http.c
--- wget-1.5.3/src/http.c	Thu Sep 10 13:14:44 1998
+++ wget-1.5.3-os2/src/http.c	Wed Sep 23 01:49:54 1998
@@ -48,6 +48,10 @@
 # include <winsock.h>
 #endif
 
+#ifdef __EMX__
+# include <os2.h>
+#endif
+
 #include "wget.h"
 #include "utils.h"
 #include "url.h"
@@ -858,7 +862,19 @@
 
   /* Determine the local filename.  */
   if (!u->local)
+#ifndef __EMX__
+    u->local = url_filename (u->proxy ? u->proxy : u);
+#else /* __EMX__ */
+  {
+    /* under os/2 there is a problems with '?' symbol in filenames */
     u->local = url_filename (u->proxy ? u->proxy : u);
+    /* remove '?' from filename under os/2 */
+    URL_OSCOMPAT(u->local);
+#ifdef ENV2
+    replace_percent(u->local);
+#endif /* ENV2 */
+  }
+#endif /* __EMX__ */
 
   if (!opt.output_document)
     locf = u->local;
@@ -925,6 +941,9 @@
 #ifdef WINDOWS
 	  ws_changetitle (hurl, 1);
 #endif
+#ifdef __EMX__
+	  os2title(0, hurl);
+#endif
 	  free (hurl);
 	}
 
@@ -1030,6 +1049,11 @@
 	      if (tmr == (time_t) (-1))
 		logputs (LOG_VERBOSE, _("\
 Last-modified header invalid -- time-stamp ignored.\n"));
+#ifdef __EMX__
+	      else
+		/* filetime seconds always even under os/2 :( */
+		tmr = tmr & 0xfffffffeL;
+#endif
 	    }
 	}
 
diff -uN wget-1.5.3/src/init.c wget-1.5.3-os2/src/init.c
--- wget-1.5.3/src/init.c	Fri Sep 11 00:20:22 1998
+++ wget-1.5.3-os2/src/init.c	Wed Sep 23 01:49:56 1998
@@ -224,7 +224,7 @@
 
   if (!home)
     {
-#ifndef WINDOWS
+#if !defined(WINDOWS) && !defined (__EMX__)
       /* If HOME is not defined, try getting it from the password
          file.  */
       struct passwd *pwd = getpwuid (getuid ());
@@ -317,7 +317,11 @@
   ln = 1;
   while ((line = read_whole_line (fp)))
     {
+#ifdef __EMX__ /* shitty emx :( */
+      char *com = NULL, *val = NULL;
+#else
       char *com, *val;
+#endif
       int status;
       int length = strlen (line);
 
diff -uN wget-1.5.3/src/main.c wget-1.5.3-os2/src/main.c
--- wget-1.5.3/src/main.c	Fri Sep 11 01:41:52 1998
+++ wget-1.5.3-os2/src/main.c	Wed Sep 23 01:49:56 1998
@@ -40,6 +40,10 @@
 #endif /* HAVE_LOCALE_H */
 #endif /* HAVE_NLS */
 
+#ifdef __EMX__
+# include "os2.h"
+#endif
+
 #define OPTIONS_DEFINED_HERE	/* for options.h */
 
 #include "wget.h"
@@ -593,7 +597,13 @@
     }
 
   if (opt.background)
+#ifndef __EMX__
     fork_to_background ();
+#else
+    /* spawn new process detached under os/2
+       fork() don't works correctly with emx */
+    spawn_process (argc, argv);
+#endif
 
   /* Allocate basic pointer.  */
   url = ALLOCA_ARRAY (char *, nurl + 1);
@@ -612,6 +622,14 @@
   ws_changetitle (*url, nurl);
 #endif
 
+#ifdef __EMX__
+  signal(SIGINT, os2break);
+  signal(SIGBREAK, os2break);
+  signal(SIGTERM, os2break);
+  os2title(1, NULL);
+  os2title(0, url[0]);
+#endif
+
   /* Initialize logging.  */
   log_init (opt.lfilename, append_to_log);
 
@@ -693,6 +711,9 @@
       convert_all_links ();
     }
   log_close ();
+#ifdef __EMX__
+  os2title(-1, NULL);
+#endif
   cleanup ();
   if (status == RETROK)
     return 0;
diff -uN wget-1.5.3/src/netrc.c wget-1.5.3-os2/src/netrc.c
--- wget-1.5.3/src/netrc.c	Tue Jun 23 21:29:18 1998
+++ wget-1.5.3-os2/src/netrc.c	Wed Sep 23 01:49:56 1998
@@ -46,7 +46,12 @@
 
 #define NETRC_FILE_NAME ".netrc"
 
+#ifndef __EMX__
 acc_t *netrc_list;
+#else
+/* hmm... */
+acc_t *netrc_list = NULL;
+#endif
 
 static acc_t *parse_netrc PARAMS ((const char *));
 
diff -uN wget-1.5.3/src/url.c wget-1.5.3-os2/src/url.c
--- wget-1.5.3/src/url.c	Fri Sep 11 00:23:26 1998
+++ wget-1.5.3-os2/src/url.c	Wed Sep 23 02:32:36 1998
@@ -56,7 +56,11 @@
    encoding, and \033 for safe printing.  */
 
 #ifndef WINDOWS
+#ifndef __EMX__
 # define URL_UNSAFE " <>\"#%{}|\\^~[]`@:\033"
+#else  /* __EMX__ */
+# define URL_UNSAFE " <>\"#%{}|\\^[]`:\033"
+#endif /* __EMX__ */
 #else  /* WINDOWS */
 # define URL_UNSAFE " <>\"%{}|\\^[]`\033"
 #endif /* WINDOWS */
@@ -171,6 +175,14 @@
 int
 contains_unsafe (const char *s)
 {
+#ifdef __EMX__
+  /* when mirroring with '-x -P x:/dir' options
+     do not check 'x:' */
+  /* check if opt.dir_prefix not '.' and contain drive letter */
+  if (!DOTP (opt.dir_prefix) && strlen(opt.dir_prefix) > 1 && 
+      *(opt.dir_prefix + 1) == ':'  && strlen(s) > 1 && *(s+1) == ':')
+    s += 2;
+#endif
   for (; *s; s++)
     if (strchr (URL_UNSAFE, *s))
       return 1;
@@ -217,15 +229,32 @@
   const char *b;
   char *p, *res;
   int i;
+#ifdef __EMX__
+  int drive_here = 0;
+#endif
 
   b = s;
   for (i = 0; *s; s++, i++)
     if (strchr (URL_UNSAFE, *s))
       i += 2; /* Two more characters (hex digits) */
+#ifdef __EMX__
+  /* skip drive letter in opt.dir_prefix */
+  if (!DOTP (opt.dir_prefix) && strlen(opt.dir_prefix) > 1 && 
+      *(opt.dir_prefix + 1) == ':'  && strlen(b) > 1 && *(b+1) == ':') {
+    drive_here = !drive_here;
+    i -= 2;
+  }
+#endif /* __EMX__  */
   res = (char *)xmalloc (i + 1);
   s = b;
+#ifndef __EMX__
   for (p = res; *s; s++)
     if (strchr (URL_UNSAFE, *s))
+#else /* __EMX__  */
+  /* skip ':' after drive letter in unsafe chars conversion */
+  for (p = res, i = 0; *s; s++, i++)
+    if (!(drive_here && i == 1) && strchr (URL_UNSAFE, *s))
+#endif /* __EMX__  */
       {
 	const unsigned char c = *s;
 	*p++ = '%';
diff -uN wget-1.5.3/src/utils.c wget-1.5.3-os2/src/utils.c
--- wget-1.5.3/src/utils.c	Sat Jun 27 20:49:12 1998
+++ wget-1.5.3-os2/src/utils.c	Wed Sep 23 02:29:08 1998
@@ -510,6 +510,9 @@
 {
   int quit = 0;
   int i;
+#ifdef __EMX__
+  int status;
+#endif
   char *dir;
 
   /* Make a copy of dir, to be able to write to it.  Otherwise, the
@@ -518,7 +521,15 @@
 
   /* If the first character of dir is '/', skip it (and thus enable
      creation of absolute-pathname directories.  */
+#ifdef __EMX__
+  /* there was a problem creating directories under os/2
+     when full directory name (with drive letter) specified. */
+  status =  (strlen(dir) > 1  && *(dir + 1) == ':') ? 2 : 0;
+  status += (*(dir + status) == '/');
+  for (i = status; 1; ++i)
+#else
   for (i = (*dir == '/'); 1; ++i)
+#endif
     {
       for (; dir[i] && dir[i] != '/'; i++)
 	;
