diff -u -r sh-utils-2.0.11/lib/basename.c sh-util2.011/lib/basename.c
--- sh-utils-2.0.11/lib/basename.c	Sat Jul 29 16:44:56 2000
+++ sh-util2.011/lib/basename.c	Fri Mar 29 09:27:06 2002
@@ -33,10 +33,16 @@
 # endif
 #endif
 
+#ifdef __MSDOS__
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
 #ifndef ISSLASH
 # define ISSLASH(C) ((C) == '/')
 #endif
 
+#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
+
 char *base_name PARAMS ((char const *name));
 
 /* In general, we can't use the builtin `basename' function if available,
@@ -60,8 +66,17 @@
     }
 
   /* If NAME is all slashes, arrange to return `/'.  */
-  if (*base == '\0' && ISSLASH (*name) && all_slashes)
-    --base;
+  if (!BACKSLASH_IS_PATH_SEPARATOR)
+    {
+      if (*base == '\0' && ISSLASH (*name) && all_slashes)
+	--base;
+    }
+  else
+    {
+      /* Need to handle drive letters. */
+      if (*base == '\0' && (ISSLASH (*name) || *name == ':') && all_slashes)
+	--base;
+    }
 
   /* Make sure the last byte is not a slash.  */
   assert (all_slashes || !ISSLASH (*(p - 1)));
diff -u -r sh-utils-2.0.11/lib/dirname.c sh-util2.011/lib/dirname.c
--- sh-utils-2.0.11/lib/dirname.c	Sat Oct 21 12:46:34 2000
+++ sh-util2.011/lib/dirname.c	Fri Mar 29 18:29:50 2002
@@ -43,6 +43,10 @@
 
 #include "dirname.h"
 
+#ifdef __MSDOS__
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
 #ifndef ISSLASH
 # define ISSLASH(C) ((C) == '/')
 #endif
@@ -78,11 +82,12 @@
 
       if (path < slash)
 	{
+	  char *tmp = slash;
 	  slash = memrchr (path, '/', slash - path);
 	  if (BACKSLASH_IS_PATH_SEPARATOR)
 	    {
-	      char *b = memrchr (path, '\\', slash - path);
-	      if (b && slash < b)
+	      char *b = memrchr (path, '\\', tmp - path);
+	      if (b && tmp && tmp < b)
 		slash = b;
 	    }
 	}
@@ -90,9 +95,21 @@
 
   if (slash == 0)
     {
-      /* File is in the current directory.  */
-      path = ".";
-      length = 1;
+      if (!BACKSLASH_IS_PATH_SEPARATOR)
+	{
+	  /* File is in the current directory.  */
+	  path = ".";
+	  length = 1;
+	}
+      else
+	{
+	  /* Check if we have something like d:/abc. */
+	  if (strlen (path) >= 2 && path[0] && path[1] == ':')
+	    {
+	      slash = (char *)path + 2;
+	      length = slash - path + 1;
+	    }
+	}
     }
   else
     {
diff -u -r sh-utils-2.0.11/lib/euidaccess.c sh-util2.011/lib/euidaccess.c
--- sh-utils-2.0.11/lib/euidaccess.c	Fri Jan  7 14:29:26 2000
+++ sh-util2.011/lib/euidaccess.c	Fri Mar 29 09:17:04 2002
@@ -159,8 +159,12 @@
     return -1;
 
   mode &= (X_OK | W_OK | R_OK);	/* Clear any bogus bits. */
-#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
+
+/* On MSDOS, we don't care about these things. */
+#ifndef __MSDOS__
+# if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
   ?error Oops, portability assumptions incorrect.
+# endif
 #endif
 
   if (mode == F_OK)
diff -u -r sh-utils-2.0.11/lib/getusershell.c sh-util2.011/lib/getusershell.c
--- sh-utils-2.0.11/lib/getusershell.c	Sat Oct 28 07:42:48 2000
+++ sh-util2.011/lib/getusershell.c	Fri Mar 29 09:22:48 2002
@@ -21,6 +21,10 @@
 # include <config.h>
 #endif
 
+#ifdef __DJGPP__
+# define SHELLS_FILE "/dev/env/DJDIR/etc/shells"
+#endif
+
 #ifndef SHELLS_FILE
 /* File containing a list of nonrestricted shells, one per line. */
 # define SHELLS_FILE "/etc/shells"
@@ -43,6 +47,9 @@
 /* List of shells to use if the shells file is missing. */
 static char const* const default_shells[] =
 {
+#ifdef __MSDOS__
+  "c:/dos/command.com", "c:/windows/command.com", "c:/command.com",
+#endif
   "/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
 };
 
diff -u -r sh-utils-2.0.11/lib/stripslash.c sh-util2.011/lib/stripslash.c
--- sh-utils-2.0.11/lib/stripslash.c	Tue Aug  8 07:18:34 2000
+++ sh-util2.011/lib/stripslash.c	Fri Mar 29 09:29:14 2002
@@ -25,6 +25,16 @@
 # include <strings.h>
 #endif
 
+#ifdef __MSDOS__
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
+
 /* Remove trailing slashes from PATH.
    This is useful when using filename completion from a shell that
    adds a "/" after directory names (such as tcsh and bash), because
@@ -37,6 +47,15 @@
   int last;
 
   last = strlen (path) - 1;
-  while (last > 0 && path[last] == '/')
+  /* Handle drive letters on MSDOS systems. */
+  if (BACKSLASH_IS_PATH_SEPARATOR)
+    {
+      if (last > 2 && path[1] == ':')
+	{
+	  path += 2;
+	  last -= 2;
+	}
+    }
+  while (last > 0 && ISSLASH (path[last]))
     path[last--] = '\0';
 }
--- package/gnu/sh-util2.01/lib/dirname.c~	Sat Mar 30 14:57:36 2002
+++ package/gnu/sh-util2.01/lib/dirname.c	Thu Apr  4 21:23:22 2002
@@ -109,6 +109,11 @@
 	      slash = (char *)path + 2;
 	      length = slash - path + 1;
 	    }
+	  else
+	    {
+	      path = ".";
+	      length = 1;
+	    }
 	}
     }
   else
