diff -u -r old/sh-utils-2.0g/lib/basename.c new/sh-utils-2.0g/lib/basename.c
--- old/sh-utils-2.0g/lib/basename.c	Fri Apr 14 14:54:02 2000
+++ new/sh-utils-2.0g/lib/basename.c	Mon Apr 24 18:08:44 2000
@@ -31,6 +31,10 @@
 # endif
 #endif
 
+#if defined __MSDOS__ && defined  __DJGPP__
+#define ISSLASH(C) (((C) == '/') || ((C) == '\\'))
+#endif
+
 #ifndef ISSLASH
 # define ISSLASH(C) ((C) == '/')
 #endif
diff -u -r old/sh-utils-2.0g/lib/euidaccess.c new/sh-utils-2.0g/lib/euidaccess.c
--- old/sh-utils-2.0g/lib/euidaccess.c	Fri Apr 14 14:54:00 2000
+++ new/sh-utils-2.0g/lib/euidaccess.c	Mon Apr 24 18:08:44 2000
@@ -159,9 +159,12 @@
     return -1;
 
   mode &= (X_OK | W_OK | R_OK);	/* Clear any bogus bits. */
+
+#ifndef __MSDOS__ /* Error occurs here on MSDOS systems. */
 #if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
   ?error Oops, portability assumptions incorrect.
 #endif
+#endif /* __MSDOS__ */
 
   if (mode == F_OK)
     return 0;			/* The file exists. */
diff -u -r old/sh-utils-2.0g/lib/nanosleep.c new/sh-utils-2.0g/lib/nanosleep.c
--- old/sh-utils-2.0g/lib/nanosleep.c	Fri Apr 14 14:54:00 2000
+++ new/sh-utils-2.0g/lib/nanosleep.c	Mon Apr 24 18:08:44 2000
@@ -80,12 +80,18 @@
       sigemptyset (&newact.sa_mask);
       newact.sa_flags = 0;
 
+#ifdef SIGCONT /* SIGCONT isn't defined by ANSI. */      
       sigaction (SIGCONT, NULL, &oldact);
       if (oldact.sa_handler != SIG_IGN)
 	sigaction (SIGCONT, &newact, NULL);
+#endif /* SIGCONT */
+      
 #else
+#ifdef SIGCONT
       if (signal (SIGCONT, SIG_IGN) != SIG_IGN)
 	signal (SIGCONT, sighandler);
+#endif /* SIGCONT */
+      
 #endif
       first_call = 0;
     }
diff -u -r old/sh-utils-2.0g/lib/readutmp.c new/sh-utils-2.0g/lib/readutmp.c
--- old/sh-utils-2.0g/lib/readutmp.c	Fri Apr 14 14:54:04 2000
+++ new/sh-utils-2.0g/lib/readutmp.c	Mon Apr 24 18:08:44 2000
@@ -17,6 +17,8 @@
 
 /* Written by jla; revised by djm */
 
+#ifndef __MSDOS__ /* We don't have this facility on DOS. */
+
 #include <config.h>
 
 #include <stdio.h>
@@ -130,3 +132,4 @@
 }
 
 #endif /* HAVE_UTMPNAME */
+#endif /* __MSDOS__ */
diff -u -r old/sh-utils-2.0g/lib/stripslash.c new/sh-utils-2.0g/lib/stripslash.c
--- old/sh-utils-2.0g/lib/stripslash.c	Fri Apr 14 14:54:04 2000
+++ new/sh-utils-2.0g/lib/stripslash.c	Mon Apr 24 18:08:44 2000
@@ -37,6 +37,10 @@
   int last;
 
   last = strlen (path) - 1;
+#ifdef __MSDOS__
+  while (last > 0 && (path[last] == '/' || path[last] == '\\'))
+#else
   while (last > 0 && path[last] == '/')
+#endif /* __MSDOS__ */
     path[last--] = '\0';
 }
diff -u -r old/sh-utils-2.0g/src/dirname.c new/sh-utils-2.0g/src/dirname.c
--- old/sh-utils-2.0g/src/dirname.c	Fri Apr 14 14:54:06 2000
+++ new/sh-utils-2.0g/src/dirname.c	Mon Apr 24 18:08:54 2000
@@ -65,6 +65,9 @@
 {
   register char *path;
   register char *slash;
+#ifdef __MSDOS__
+  register char *temp;
+#endif /* __MSDOS__ */
 
   program_name = argv[0];
   setlocale (LC_ALL, "");
@@ -92,12 +95,31 @@
   strip_trailing_slashes (path);
 
   slash = strrchr (path, '/');
+#ifdef __MSDOS__
+  /* In case a backslash was used, check which one should be
+     stripped. */
+  temp = strrchr (path, '\\');
+  if (!slash) slash = temp;
+  else
+      if (temp && temp > slash) slash = temp;
+#endif /* __MSDOS__ */
+  
+#ifdef __MSDOS__	  
+  if (slash == NULL && strlen(path) >= 2)
+    {
+      if (path[1] != ':')
+	  path = (char *) ".";
+      else
+	  path[2] = '\0';
+    }
+#else
   if (slash == NULL)
-    path = (char *) ".";
+      path = (char *) ".";
+#endif /* __MSDOS__ */
   else
     {
       /* Remove any trailing slashes and final element. */
-      while (slash > path && *slash == '/')
+      while (slash > path && (*slash == '/' || *slash == '\\'))
 	--slash;
       slash[1] = 0;
     }
diff -u -r old/sh-utils-2.0g/src/pathchk.c new/sh-utils-2.0g/src/pathchk.c
--- old/sh-utils-2.0g/src/pathchk.c	Fri Apr 14 14:54:06 2000
+++ new/sh-utils-2.0g/src/pathchk.c	Mon Apr 24 18:08:54 2000
@@ -276,6 +276,25 @@
   parent = xstrdup (*path == '/' ? "/" : ".");
 
   slash = path;
+
+#ifdef MSDOS
+  if (path [0] && path[1] == ':')
+    {
+      /* If we have a pathname with a drive, make sure it's explicit
+	 (i.e. instead of "d:foo/bar" get "d:/curdir/foo/bar").  */
+      char *normalized_path = alloca(PATH_MAX + 1);
+      int c;
+
+      _fixpath (path, normalized_path);
+      c = normalized_path[3];
+      normalized_path[3] = 0;
+      parent = xstrdup (normalized_path);
+      normalized_path[3] = c;
+      path = normalized_path;
+      slash = path + 2;		/* point to the leftmost slash */
+    }
+#endif
+
   last_elem = 0;
   while (1)
     {
diff -u -r old/sh-utils-2.0g/src/pinky.c new/sh-utils-2.0g/src/pinky.c
--- old/sh-utils-2.0g/src/pinky.c	Fri Apr 14 14:54:06 2000
+++ new/sh-utils-2.0g/src/pinky.c	Mon Apr 24 18:08:54 2000
@@ -24,8 +24,13 @@
 
 #include "system.h"
 #include "error.h"
+
+#ifndef __MSDOS__ /* We don't have this facility on MSDOS. */
+
 #include "readutmp.h"
 
+#endif /* __MSDOS__ */
+
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "pinky"
 
@@ -81,6 +86,8 @@
   {NULL, 0, NULL, 0}
 };
 
+#ifndef __MSDOS__ /* In DOS, we don't need pinky. */
+
 /* Count and return the number of ampersands in STR.  */
 
 static int
@@ -455,9 +462,12 @@
     print_long_entry (argv_names[i]);
 }
 
+#endif /* __MSDOS__ */
+
 void
 usage (int status)
 {
+#ifndef __MSDOS__ /* Let the user know we don't have this. */
   if (status != 0)
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
 	     program_name);
@@ -484,6 +494,9 @@
 "), UTMP_FILE);
       puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
     }
+#else /* __MSDOS__ */
+  printf(_("%s not available on MS-DOS\n"), program_name);
+#endif /* __MSDOS__ */
   exit (status);
 }
 
@@ -493,6 +506,9 @@
   int optc, longind;
 
   program_name = argv[0];
+#ifdef __MSDOS__  /* If it's MSDOS, we just print a message and quit. */
+  usage(1);
+#else /* __MSDOS__ */
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -561,6 +577,6 @@
     short_pinky (UTMP_FILE, argc - optind, argv + optind);
   else
     long_pinky (argc - optind, argv + optind);
-
+#endif /* __MSDOS__ */
   exit (0);
 }
diff -u -r old/sh-utils-2.0g/src/su.c new/sh-utils-2.0g/src/su.c
--- old/sh-utils-2.0g/src/su.c	Fri Apr 14 14:54:06 2000
+++ new/sh-utils-2.0g/src/su.c	Mon Apr 24 18:08:54 2000
@@ -274,6 +274,10 @@
 static int
 correct_password (const struct passwd *pw)
 {
+#ifdef __MSDOS__
+	return 1;
+#else /* __MSDOS__ */
+	
   char *unencrypted, *encrypted, *correct;
 #if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
   /* Shadow passwd stuff for SVR3 and maybe other systems.  */
@@ -298,6 +302,7 @@
   encrypted = crypt (unencrypted, correct);
   memset (unencrypted, 0, strlen (unencrypted));
   return strcmp (encrypted, correct) == 0;
+#endif /* __MSDOS__ */
 }
 
 /* Update `environ' for the new shell based on PW, with SHELL being
@@ -520,7 +525,12 @@
   if (optind < argc)
     additional_args = argv + optind;
 
+#ifndef __MSDOS__
   pw = getpwnam (new_user);
+#else
+  pw = getpwnam (getlogin());
+#endif /* __MSDOS__ */
+
   if (pw == 0)
     error (1, 0, _("user %s does not exist"), new_user);
   endpwent ();
diff -u -r old/sh-utils-2.0g/src/test.c new/sh-utils-2.0g/src/test.c
--- old/sh-utils-2.0g/src/test.c	Fri Apr 14 14:54:06 2000
+++ new/sh-utils-2.0g/src/test.c	Mon Apr 24 18:08:54 2000
@@ -156,6 +156,11 @@
   struct stat st;
   static int euid = -1;
 
+#ifdef __MSDOS__
+  /* The bits in MODE are different for `access' and `stat'.
+     Besides, MSDOS doesn't care about uid/euid issues.  */
+  return access (path, mode);
+#else /* not MSDOS */
   if (test_stat (path, &st) < 0)
     return (-1);
 
@@ -183,6 +188,7 @@
     return (0);
 
   return (-1);
+#endif /* not MSDOS. */
 }
 
 /* Increment our position in the argument list.  Check that we're not
diff -u -r old/sh-utils-2.0g/src/users.c new/sh-utils-2.0g/src/users.c
--- old/sh-utils-2.0g/src/users.c	Fri Apr 14 14:54:08 2000
+++ new/sh-utils-2.0g/src/users.c	Mon Apr 24 18:08:54 2000
@@ -23,7 +23,10 @@
 
 #include "error.h"
 #include "long-options.h"
+
+#ifndef __MSDOS__
 #include "readutmp.h"
+#endif /* __MSDOS__ */
 #include "system.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
@@ -47,6 +50,8 @@
   return strcmp (*a, *b);
 }
 
+#ifndef __MSDOS__ /* This package isn't needed on DOS. */
+
 static void
 list_entries_users (int n, const STRUCT_UTMP *this)
 {
@@ -104,9 +109,12 @@
   list_entries_users (n_users, utmp_buf);
 }
 
+#endif /* __MSDOS__ */
+
 void
 usage (int status)
 {
+#ifndef __MSDOS__
   if (status != 0)
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
 	     program_name);
@@ -122,6 +130,10 @@
 	      UTMP_FILE, WTMP_FILE);
       puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
     }
+#else /* __MSDOS__ */
+  printf(_("%s not available on MS-DOS\n"), program_name);
+#endif /* __MSDOS__ */
+
   exit (status);
 }
 
@@ -129,7 +141,11 @@
 main (int argc, char **argv)
 {
   int optc, longind;
+
   program_name = argv[0];
+#ifdef __MSDOS__
+  usage(1);
+#else /* __MSDOS__ */
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -163,6 +179,6 @@
       error (0, 0, _("too many arguments"));
       usage (1);
     }
-
+#endif /* __MSDOS__ */
   exit (0);
 }
diff -u -r old/sh-utils-2.0g/src/who.c new/sh-utils-2.0g/src/who.c
--- old/sh-utils-2.0g/src/who.c	Fri Apr 14 14:54:08 2000
+++ new/sh-utils-2.0g/src/who.c	Mon Apr 24 18:08:54 2000
@@ -29,7 +29,11 @@
 #include <stdio.h>
 
 #include "error.h"
+
+#ifndef __MSDOS__
 #include "readutmp.h"
+#endif /* __MSDOS_- */
+
 #include "system.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
@@ -86,6 +90,8 @@
   {NULL, 0, NULL, 0}
 };
 
+#ifndef __MSDOS__
+
 /* Return a string representing the time between WHEN and the time
    that this function is first run. */
 
@@ -350,9 +356,12 @@
   print_entry (utmp_entry);
 }
 
+#endif /* __MSDOS__ */
+
 void
 usage (int status)
 {
+#ifndef __MSDOS__
   if (status != 0)
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
 	     program_name);
@@ -378,6 +387,10 @@
 "), UTMP_FILE, WTMP_FILE);
       puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
     }
+#else /* __MSDOS__ */
+  printf(_("%s not available on MS-DOS\n"), program_name);
+#endif /* __MSDOS__ */
+  
   exit (status);
 }
 
@@ -388,6 +401,9 @@
   int my_line_only = 0;
 
   program_name = argv[0];
+#ifdef __MSDOS__
+  usage(1);
+#else /* __MSDOS__ */
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -462,6 +478,6 @@
       error (0, 0, _("too many arguments"));
       usage (1);
     }
-
+#endif /* __MSDOS__ */
   exit (0);
 }
