diff -u -r sh-utils-2.0.11/src/pathchk.c sh-util2.011/src/pathchk.c
--- sh-utils-2.0.11/src/pathchk.c	Sat May  6 14:16:06 2000
+++ sh-util2.011/src/pathchk.c	Fri Mar 29 09:49:48 2002
@@ -96,6 +96,12 @@
 # define NAME_MAX_FOR(p) NAME_MAX
 #endif
 
+#ifdef __MSDOS__
+# define BACKSLASH_IS_PATH_SEPARATOR 1
+#else
+# define BACKSLASH_IS_PATH_SEPARATOR 0
+#endif
+
 static int validate_path PARAMS ((char *path, int portability));
 
 /* The name this program was run with. */
@@ -280,6 +286,20 @@
 
   slash = path;
   last_elem = 0;
+  if (BACKSLASH_IS_PATH_SEPARATOR)
+    {
+      if (path[1] == ':' && path[2] == '\0')
+	return 0;
+      /* If we have a pathname, make sure all backslashes are
+	 converted to forward slashes since they are equivalent. */
+      while ( (slash = strchr (slash, '\\')) != NULL)
+	*slash = 0;
+      slash = path;
+      if (path[1] == ':')
+	slash = path + 2;
+      if (*slash == 0)
+	return 0;
+    }
   while (1)
     {
       int name_max;
diff -u -r sh-utils-2.0.11/src/su.c sh-util2.011/src/su.c
--- sh-utils-2.0.11/src/su.c	Mon Aug  7 16:46:32 2000
+++ sh-util2.011/src/su.c	Fri Mar 29 10:25:44 2002
@@ -125,7 +125,11 @@
 #ifdef _PATH_DEFPATH
 # define DEFAULT_LOGIN_PATH _PATH_DEFPATH
 #else
-# define DEFAULT_LOGIN_PATH ":/usr/ucb:/bin:/usr/bin"
+# ifndef __MSDOS__
+#  define DEFAULT_LOGIN_PATH ":/usr/ucb:/bin:/usr/bin"
+# else
+#  define DEFAULT_LOGIN_PATH "c:/dos;c:/windows;c:/"
+# endif
 #endif
 
 /* The default PATH for simulated logins to superuser accounts.  */
@@ -136,10 +140,23 @@
 #endif
 
 /* The shell to run if none is given in the user's passwd entry.  */
-#define DEFAULT_SHELL "/bin/sh"
+#ifndef __MSDOS__
+# define DEFAULT_SHELL "/bin/sh"
+#else
+# define DEFAULT_SHELL "command.com"
+#endif
 
 /* The user to become if none is specified.  */
-#define DEFAULT_USER "root"
+#ifndef __MSDOS__
+# define DEFAULT_USER "root"
+#else
+# define DEFAULT_USER getlogin ()
+#endif
+
+#ifdef __DJGPP__
+# define HAVE__IS_DOS_SHELL 1
+# define HAVE__FIXPATH 1
+#endif
 
 char *crypt ();
 char *getpass ();
@@ -282,6 +299,11 @@
     correct = sp->sp_pwdp;
   else
 #endif
+#ifdef __MSDOS__
+    /* On MSDOS, we have only one user, i.e. the equivalent of
+       root on other systems. So, no point checking password. */
+    return 1;
+#else /* __MSDOS__ */
     correct = pw->pw_passwd;
 
   if (getuid () == 0 || correct == 0 || correct[0] == '\0')
@@ -296,6 +318,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
@@ -359,6 +382,7 @@
 
 /* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
    If COMMAND is nonzero, pass it to the shell with the -c option.
+   In case of MSDOS shells, pass with /c option.
    If ADDITIONAL_ARGS is nonzero, pass it to the shell as more
    arguments.  */
 
@@ -390,8 +414,21 @@
     args[argno++] = "-f";
   if (command)
     {
+#if HAVE__IS_DOS_SHELL
+      if (_is_dos_shell (shell))
+	{
+	  args[argno++] = "/c";
+	  args[argno++] = command;
+	}
+      else
+	{
+	  args[argno++] = "-c";
+	  args[argno++] = command;
+	}
+#else
       args[argno++] = "-c";
       args[argno++] = command;
+#endif
     }
   if (additional_args)
     for (; *additional_args; ++additional_args)
@@ -410,6 +447,14 @@
 {
   char *line;
 
+#if HAVE__FIXPATH
+  /* Convert all slashes to forward style, make sure the
+     letter case in both SHELL and LINE is consistent.  */
+  char shellbuf[PATH_MAX];
+
+  _fixpath (shell, shellbuf);
+  shell = shellbuf;
+#endif
   setusershell ();
   while ((line = getusershell ()) != NULL)
     {
@@ -521,7 +566,22 @@
 
   pw = getpwnam (new_user);
   if (pw == 0)
+#ifdef __DJGPP__
+    {
+      /* On MSDOS, allow them to become anyone.  */
+      extern char * __dosexec_find_on_path (const char *, char **, char *);
+      char found_at[PATH_MAX];
+
+      pw = (struct passwd *)alloca (sizeof (struct passwd));
+      pw->pw_name = DEFAULT_USER;
+      pw->pw_dir = "c:/";
+      pw->pw_shell = __dosexec_find_on_path ("command.com", environ, found_at);
+      pw->pw_uid = getuid ();
+      pw->pw_gid = getgid ();
+    }
+#else
     error (1, 0, _("user %s does not exist"), new_user);
+#endif
   endpwent ();
 
   /* Make sure pw->pw_shell is non-NULL.  It may be NULL when NEW_USER
@@ -554,7 +614,13 @@
 #endif
 
   if (shell == 0 && change_environment == 0)
-    shell = getenv ("SHELL");
+    {
+#ifndef __MSDOS__
+      shell = getenv ("SHELL");
+# else
+      shell = getenv ("COMSPEC");
+#endif
+    }
   if (shell != 0 && getuid () && restricted_shell (pw->pw_shell))
     {
       /* The user being su'd to has a nonstandard shell, and so is
diff -u -r sh-utils-2.0.11/src/system.h sh-util2.011/src/system.h
--- sh-utils-2.0.11/src/system.h	Wed Apr 19 21:41:24 2000
+++ sh-util2.011/src/system.h	Fri Mar 29 10:16:14 2002
@@ -166,6 +166,11 @@
 # undef O_TEXT
 #endif
 
+#ifdef __DJGPP__
+int _is_dos_shell (const char *);
+void _fixpath (const char *, char *);
+#endif
+
 #if O_BINARY
 # ifndef __DJGPP__
 #  define setmode _setmode
diff -u -r sh-utils-2.0.11/src/test.c sh-util2.011/src/test.c
--- sh-utils-2.0.11/src/test.c	Sat May  6 14:21:08 2000
+++ sh-util2.011/src/test.c	Fri Mar 29 10:23:00 2002
@@ -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);
+#endif /* not MSDOS */
   if (test_stat (path, &st) < 0)
     return (-1);
 
@@ -656,6 +661,17 @@
     case 'x':			/* File is executable? */
       unary_advance ();
       value = -1 != eaccess (argv[pos - 1], X_OK);
+#ifdef __DJGPP__
+      /* Shell scripts say ``test -x prog'', but DOS executables are
+	 called `prog.exe', `prog.com' etc.  Make so they are found.  */
+      {
+	char arg_path[PATH_MAX];
+
+	if (value == FALSE &&
+	    __dosexec_find_on_path (argv[pos -1], (char **)0, arg_path))
+	  value = -1 != eaccess (arg_path, X_OK);
+      }
+#endif
       return (TRUE == value);
 
     case 'O':			/* File is owned by you? */
