Files com075e/28.com and com075f/28.com are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/alias.c com075f/alias.c
--- com075e/alias.c	Thu Nov 19 10:59:18 1998
+++ com075f/alias.c	Thu Dec  3 14:56:30 1998
@@ -18,6 +18,10 @@
  *
  * 1998/10/27 ska
  * - changed: rmtmpfile() closes file itself
+ *
+ * 01-Dec-1998  John P. Price
+ * - changed to convert to lower case instead of upper
+ *
  */
 
 #include "config.h"
@@ -47,15 +51,14 @@
 static unsigned short useFlag = 0;
 static TAlias *first = 0,
  *last = 0;
-static FILE *tmp;
 
 /* module internal functions */
-void partstrupr(char *str)      /* strupr only for first word in string */
+void partstrlower(char *str)    /* strlwr only for first word in string */
 {
   char *c = str;
   while (*c && !isspace(*c))
   {
-    *c = toupper(*c);
+    *c = tolower(*c);
     c++;
   }
 }
@@ -143,7 +146,7 @@
     return -1;
   }
   strcpy(ptr->subst, subst);
-  partstrupr(ptr->subst);       /* it's necessary for recursive substitution */
+  partstrlower(ptr->subst);     /* it's necessary for recursive substitution */
 
   ptr->used = 0;
 
@@ -216,9 +219,9 @@
   while (isspace(cmd[n]))
     n++;
 
-  partstrupr(&cmd[n]);
+  partstrlower(&cmd[n]);
 
-  if (!strncmp(&cmd[n], "NOALIAS", 7) && (isspace(cmd[n + 7]) || cmd[n + 7] == '\0'))
+  if (!strncmp(&cmd[n], "noalias", 7) && (isspace(cmd[n + 7]) || cmd[n + 7] == '\0'))
   {
     memmove(cmd, &cmd[n + 7], strlen(&cmd[n + 7]) + 1);
     return;
@@ -254,20 +257,33 @@
   }
 }
 
-int aliasswapout(void)
+int aliassave(char *dir, char *name)
 {
   TAlias *ptr = first;
   TAlias *old;
+  char *buf;
+  FILE *f;
 
-  tmp = tempfile();
-  if (!tmp)
-    return -1;
+  if (!ptr)
+    return 0;
+
+  buf = malloc(256);
+  if (!buf)
+    return 1;
+
+  strcpy(buf, dir);
+  strcat(buf, name);
+  if ((f = fopen(buf, "w")) == NULL)
+  {
+    return 0;
+  }
+  free(buf);
 
   while (ptr)
   {
-    if (fprintf(tmp, "%s=%s\n", ptr->name, ptr->subst) == EOF)
+    if (fprintf(f, "%s=%s\n", ptr->name, ptr->subst) == EOF)
     {
-      rmtmpfile();
+      fclose(f);
       return -1;
     }
     ptr = ptr->next;
@@ -281,26 +297,40 @@
     free(old->subst);
     free(old);
   }
+  fclose(f);
 
   return 0;
 }
 
-int aliasswapin(void)
+int aliasload(char *dir, char *name)
 {
-  char buf[1024];
+  char *buf;
+  FILE *f;
 
-  fseek(tmp, 0, SEEK_SET);      /* reset file pointer */
+  buf = malloc(256);
+  if (!buf)
+    return 1;
 
-  while (fgets(buf, sizeof(buf), tmp))
+  strcpy(buf, dir);
+  strcat(buf, name);
+  printf("Reading aliases from %s\n", buf);
+  if ((f = fopen(buf, "r")) == NULL)
+  {
+    return 0;
+  }
+
+  while (fgets(buf, 256, f))
   {
     buf[strlen(buf) - 1] = '\0';
     if (cmd_alias(buf) == -1)
+    {
+      free(buf);
       return -1;
   }
+  }
   useFlag = 0;
-
-  rmtmpfile();                  /* close and delete temporary file */
-
+  free(buf);
+  fclose(f);
   return 0;
 }
 
@@ -325,7 +355,7 @@
   /* Split rest into name and substitute */
   *ptr++ = '\0';
 
-  partstrupr(rest);
+  partstrlower(rest);
 
   if (ptr[0] == '\0')
     aliasdel(rest);
Files com075e/alias.h and com075f/alias.h are identical
Only in com075f: alias.sys
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/batch.c com075f/batch.c
--- com075e/batch.c	Mon Sep 14 00:21:50 1998
+++ com075f/batch.c	Tue Dec  1 13:06:28 1998
@@ -322,7 +322,7 @@
 char *readbatchline(int *eflag, char *textline, int size)
 {
   /*
-   * Read and return the next executable line form the current batch file
+   * Read and return the next executable line from the current batch file
    *
    * If no batch file is current or no further executable lines are found
    * return NULL.
@@ -368,7 +368,7 @@
         /* Wild file spec, find first (or next) file name */
       {
         if (bc->ffind)          /* First already done fo do next */
-          fv = !findnext(bc->ffind) ? bc->ffind->ff_name : NULL;
+          fv = !FINDNEXT(bc->ffind) ? bc->ffind->ff_name : NULL;
         else
           /*  For first find, allocate a find first block */
         {
@@ -378,7 +378,7 @@
             break;
           }
 
-          fv = !findfirst(fv, bc->ffind, FA_NORMAL) ?
+          fv = !FINDFIRST(fv, bc->ffind, FA_NORMAL) ?
               bc->ffind->ff_name : NULL;
         }
 
Files com075e/batch.h and com075f/batch.h are identical
Files com075e/beep.c and com075f/beep.c are identical
Files com075e/break.c and com075f/break.c are identical
Files com075e/build.bat and com075f/build.bat are identical
Files com075e/call.c and com075f/call.c are identical
Files com075e/cb_catch.asm and com075f/cb_catch.asm are identical
Files com075e/clean.bat and com075f/clean.bat are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/cls.c com075f/cls.c
--- com075e/cls.c	Mon Sep 14 00:21:50 1998
+++ com075f/cls.c	Mon Nov 30 18:26:24 1998
@@ -9,6 +9,10 @@
  * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
  * - added config.h include
  *
+ * 30-Nov-1998 (John P Price <linux-guru@gcfl.net>)
+ * - CLS now sets the text colors to lightgray on black before clearing the
+ *   screen.
+ *
  */
 
 #include "config.h"
@@ -22,6 +26,8 @@
 #pragma argsused
 int cmd_cls(char *rest)
 {
+  textcolor(LIGHTGRAY);
+  textbackground(BLACK);
   clrscr();
   return 0;
 }
Files com075e/cmdinput.c and com075f/cmdinput.c are identical
Files com075e/cmdtable.c and com075f/cmdtable.c are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/command.c com075f/command.c
--- com075e/command.c	Thu Nov 19 20:38:50 1998
+++ com075f/command.c	Thu Dec  3 15:35:16 1998
@@ -100,11 +100,22 @@
  * 19-Nov-1998 (Rob Green <robg@sundial.net>)
  * - changed line in is_delim function to include backslash and period.
  *
+ * 30-Nov-1998 (Rob Green <robg@sundial.net>)
+ * - Removed previous change (Opps)
+ *
+ * 30-Nov-1998 (John P Price <linux-guru@gcfl.net>)
+ * - Added code to remove white space from end of command in docommand
+ *   function.  Also added nextcmd char pointer so we don't loose the other
+ *   commands in the line.
+ *   This fixes the bug with "type filename.c | more"
+ *   (marked with "JPP 19981130")
+ *
  */
 
 #include "config.h"
 
 #include <stdio.h>
+#include <conio.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
@@ -147,8 +158,7 @@
    *
    */
 
-  return (c == '/' || c == '=' || c == 0 || isspace(c) || c == '\\' ||
-          c == '.');
+  return (c == '/' || c == '=' || c == 0 || isspace(c));
 }
 
 static void execute(char *first, char *rest)
@@ -245,6 +255,10 @@
   while (isspace(*rest))        /* Skip over initial white space */
     rest++;
 
+  /* JPP 19981130 */
+  while (isspace(rest[strlen(rest) - 1]))	/* delete white space at end of command */
+    rest[strlen(rest) - 1] = '\0';
+
   cstart = rest;
 
   if (*rest)                    /* Anything to do ? */
@@ -317,6 +331,7 @@
   char *out = NULL;
   char *fname0 = NULL;
   char *fname1 = NULL;
+  char *nextcmd;
 
   int of_attrib = O_CREAT | O_TRUNC | O_TEXT | O_WRONLY;
   int num;
@@ -359,9 +374,10 @@
     close(1);                   /* Close current output file */
     if ((fname0 = tmpfn()) == NULL)
       goto abort;
-    open(fname0, O_CREAT | O_TRUNC | O_TEXT | O_WRONLY,
-         S_IREAD | S_IWRITE);
+    open(fname0, O_CREAT | O_TRUNC | O_TEXT | O_WRONLY, S_IREAD | S_IWRITE);
 
+    /* JPP 19981130 */
+    nextcmd = s + strlen(s) + 1;
     docommand(s);
 
     close(0);
@@ -370,7 +386,8 @@
     fname0 = NULL;
     open(fname1, O_TEXT | O_RDONLY, S_IREAD);
 
-    s = s + strlen(s) + 1;
+    /* JPP 19981130 */
+    s = nextcmd;
   }
 
   /* Now set up the end conditions... */
@@ -434,6 +451,7 @@
   char *tp;
   char *ip;
   char *cp;
+  int ch;
 
   /* JPP 19980807 - changed name so not to conflict with echo global */
   int echothisline;
@@ -460,6 +478,8 @@
         break;                  // out of the do loop
 
       readcommand(readline, MAX_INTERNAL_COMMAND_SIZE);
+      tracemode = 0;            //reset trace mode
+
       ip = readline;
       echothisline = 0;
     }
@@ -536,10 +556,34 @@
       puts(commandline);
     }
 
+    if (tracemode)
+    {
+      printf("%s [Enter=Y,Esc=N]? ", commandline);
+      do
+      {
+        ch = toupper(getch());
+        if ((ch == 0x1B) || (ch == 'N'))	//pressed ESC or N?
+
+        {
+          puts("N");
+          *commandline = 0;     // erase command line to skip line
+
+        }
+        else if ((ch == '\n') || (ch == 'Y'))	//pressed ENTER or Y?
+
+        {
+          puts("Y");
+        }
+        else
+          ch = 0;
+      }
+      while (ch == 0);
+    }
+
     if (*commandline)
     {
       parsecommandline(commandline);
-      if (echo)
+      if (echothisline || echo)
         putchar('\n');          /* JPP 19980807 */
     }
   }
@@ -555,8 +599,10 @@
   /*
    * * main function
    */
-  initialize(argc, argv);       /* check switches on command-line */
 
-  process_input(0);
+  /* check switches on command-line */
+  /*JPP 19981201 if /c switch, then execute command and get out.
+     initialize returns 1 if /c, else returns 0 */
+  process_input(initialize(argc, argv));
   return 0;
 }
Binary files com075e/command.com and com075f/command.com differ
Binary files com075e/command.dsk and com075f/command.dsk differ
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/command.h com075f/command.h
--- com075e/command.h	Thu Nov 19 14:05:10 1998
+++ com075f/command.h	Thu Dec  3 12:39:42 1998
@@ -35,6 +35,9 @@
 extern char *shellver;
 extern char *shellname;
 
+#define FINDFIRST(path,attrib,ffblk) findfirst(path,attrib,ffblk)
+#define FINDNEXT(ffblk)  findnext(ffblk)
+#define FINDSTOP(ffblk)
 
 enum
 {
@@ -47,6 +50,7 @@
 extern int errorlevel;
 extern unsigned far *maxx;
 extern unsigned char far *maxy;
+extern char *ComDir;            //this is the directory command.com is in.
 
 void fatal_error(char *);
 char is_delim(char);
@@ -54,7 +58,7 @@
 void command(char *);
 void parsecommandline(char *);
 int c_brk(void);
-void initialize(int, char *[]);
+int initialize(int, char *[]);
 void short_version(void);
 
 /* prototypes for INTERNAL.C */
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/command.mak com075f/command.mak
--- com075e/command.mak	Thu Nov 19 21:59:54 1998
+++ com075f/command.mak	Mon Sep 14 00:05:34 1998
@@ -68,7 +68,6 @@
  copy.obj \
  messages.obj \
  cb_catch.obj \
- tmpnam.obj \
  {$(LIBPATH)}suppl_s.lib
 
 #		*Explicit Rules*
@@ -122,8 +121,7 @@
 ctty.obj+
 copy.obj+
 messages.obj+
-cb_catch.obj+
-tmpnam.obj
+cb_catch.obj
 command,command
 suppl_s.lib+
 cs.lib
@@ -230,12 +228,9 @@
 cb_catch.obj: command.cfg cb_catch.asm 
 	$(TASM) /MX /ZI /O CB_CATCH.ASM,CB_CATCH.OBJ
 
-tmpnam.obj: command.cfg tmpnam.c 
-
 #		*Compiler Configuration File*
 command.cfg: command.mak
   copy &&|
--a
 -f-
 -ff-
 -K
Binary files com075e/command.prj and com075f/command.prj differ
Files com075e/config.h and com075f/config.h are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/copy.c com075f/copy.c
--- com075e/copy.c	Mon Sep 14 00:21:56 1998
+++ com075f/copy.c	Thu Dec  3 14:59:26 1998
@@ -446,7 +446,7 @@
   while (sources->next != NULL)
   {
     fnsplit(sources->file, drive_s, dir_s, file_s, ext_s);
-    done = findfirst(sources->file, &ffblk, FA_ARCH);
+    done = FINDFIRST(sources->file, &ffblk, FA_ARCH);
     if (done)
     {
       error_file_not_found();
@@ -490,7 +490,7 @@
       if (copy(real_source, real_dest, *append, flags))
         copied++;
     next:
-      done = findnext(&ffblk);
+      done = FINDNEXT(&ffblk);
       if (multiple)
         *append = 1;
     }
@@ -621,7 +621,7 @@
 
   delete_list(start);
   freep(p);
-  printf("\t%d file(s) copied\n", copied);
+  printf("        %d file(s) copied\n", copied);
   return 1;
 }
 
Files com075e/copy.h and com075f/copy.h are identical
Files com075e/ctty.c and com075f/ctty.c are identical
Files com075e/date.c and com075f/date.c are identical
Files com075e/datefunc.c and com075f/datefunc.c are identical
Files com075e/datefunc.h and com075f/datefunc.h are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/del.c com075f/del.c
--- com075e/del.c	Thu Nov 19 10:59:38 1998
+++ com075f/del.c	Thu Dec  3 15:00:18 1998
@@ -142,7 +142,7 @@
         	/* Under DOS everything seems to be possible, even to
         		successfully stat() "C:\\TEMP\\*.*" ?!
         		At least with some compilers.
-        			- 1998/10/27 ska*/
+       - 1998/10/27 ska */
         && strpbrk(fullname, "?*") == NULL)	/* no wildcards */
     {
       if (p[-1] != '\\')
@@ -189,7 +189,7 @@
     }
   }
 
-  if (findfirst(fullname, &f, FA_ARCH))
+  if (FINDFIRST(fullname, &f, FA_ARCH))
   {
 
     error_sfile_not_found(fullname);
@@ -234,7 +234,7 @@
 #endif
 
   }
-  while (findnext(&f) == 0);
+  while (FINDNEXT(&f) == 0);
 
   return 0;
 }
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/dir.c com075f/dir.c
--- com075e/dir.c	Mon Sep 14 01:21:52 1998
+++ com075f/dir.c	Thu Dec  3 15:35:16 1998
@@ -97,6 +97,10 @@
  * 10-Aug-1998 ska
  * - added checks for ^break
  *
+ * 03-Dec-1998 John P Price
+ * - Rewrote DIR command.  fixed problem with "DIR .COM" and other bugs
+ *   Recursive switch does not work now, but it will be added soon.
+ *
  */
 
 #include "config.h"
@@ -227,205 +231,6 @@
 }
 
 /*
- * extend_file
- *
- * extend the filespec, possibly adding wildcards
- */
-void extend_file(char **file)
-{
-  char *tmp;
-
-  if (!*file)
-    return;
-
-  /* if no file spec, change to *.* */
-  if (!**file)
-  {
-    free(*file);
-    *file = strdup("*.*");
-    return;
-  }
-
-  /* if starts with . add * in front */
-  if (**file == '.')
-  {
-    tmp = malloc(strlen(*file) + 2);
-    if (tmp)
-    {
-      *tmp = '*';
-      strcpy(&tmp[1], *file);
-    }
-    free(*file);
-    *file = tmp;
-    return;
-  }
-
-  /* if no . add .* */
-  if (strchr(*file, '.') == NULL)
-  {
-    tmp = malloc(strlen(*file) + 3);
-    if (tmp)
-    {
-      strcpy(tmp, *file);
-      strcat(tmp, ".*");
-    }
-    free(*file);
-    *file = tmp;
-    return;
-  }
-}
-
-/*
- * dir_parse_pathspec
- *
- * split the pathspec into drive, directory, and filespec
- */
-int dir_parse_pathspec(char *pathspec, int *drive, char **dir, char **file)
-{
-  char *start = NULL;
-  char *tmp = NULL;
-  char *orig_dir = NULL;
-  int i;
-  int wildcards = 0;
-
-  *file = NULL;
-  *dir = NULL;
-
-  /* get the drive and change to it */
-  if (pathspec[1] == ':')
-  {
-    *drive = toupper(pathspec[0]) - 'A';
-    start = pathspec + 2;
-    setdisk(*drive);
-  }
-  else
-  {
-    *drive = getdisk();
-    start = pathspec;
-  }
-
-  orig_dir = getcwd(NULL, MAXDIR);
-
-  /* check for wildcards */
-  for (i = 0; pathspec[i]; i++)
-    if (pathspec[i] == '*' || pathspec[i] == '?')
-      wildcards = 1;
-
-  /* check if this spec is a directory */
-  if (!wildcards)
-  {
-    if (chdir(pathspec) == 0)
-    {
-      *file = strdup("*.*");
-      if (!*file)
-      {
-        free(orig_dir);
-        MEM_ERR
-      }
-      tmp = getcwd(NULL, 128);
-      if (!tmp)
-      {
-        free(*file);
-        chdir(orig_dir);
-        free(orig_dir);
-        MEM_ERR
-      }
-      *dir = strdup(&tmp[2]);
-      free(tmp);
-      if (!*dir)
-      {
-        free(*file);
-        chdir(orig_dir);
-        free(orig_dir);
-        MEM_ERR
-      }
-
-      chdir(orig_dir);
-      return 0;
-    }
-  }
-
-  /* find the file spec */
-  tmp = strrchr(start, '\\');
-
-  /* if no path is specified */
-  if (!tmp)
-  {
-    *file = strdup(start);
-    extend_file(file);
-    if (!*file)
-    {
-      MEM_ERR
-    }
-
-    tmp = getcwd(NULL, 128);
-    if (!tmp)
-    {
-      free(*file);
-      chdir(orig_dir);
-      free(orig_dir);
-      MEM_ERR
-    }
-    *dir = strdup(&tmp[2]);
-    free(tmp);
-    if (!*dir)
-    {
-      free(*file);
-      chdir(orig_dir);
-      free(orig_dir);
-      MEM_ERR
-    }
-
-    return 0;
-  }
-
-  /* get the filename */
-  *file = strdup(tmp + 1);
-  extend_file(file);
-  if (!*file)
-  {
-    MEM_ERR
-  }
-
-  *tmp = 0;
-
-  /* change to this directory and get its full name */
-  if (chdir(start) < 0)
-  {
-    error_path_not_found();
-    *tmp = '\\';
-    free(*file);
-    chdir(orig_dir);
-    free(orig_dir);
-    return 1;
-  }
-
-  tmp = getcwd(NULL, MAXDIR);
-  if (!tmp)
-  {
-    free(*file);
-    chdir(orig_dir);
-    free(orig_dir);
-    MEM_ERR
-  }
-  *dir = strdup(&tmp[2]);
-  free(tmp);
-  if (!*dir)
-  {
-    free(*file);
-    chdir(orig_dir);
-    free(orig_dir);
-    MEM_ERR
-  }
-
-  *tmp = '\\';
-
-  chdir(orig_dir);
-  free(orig_dir);
-  return 0;
-}
-
-/*
  * pause
  *
  * pause until a key is pressed
@@ -477,23 +282,27 @@
   struct ffblk f;
   struct SREGS s;
   union REGS r;
+  int disk;
 
   if (cbreak)
     return 1;
 
   if (flags & DIR_BARE)
     return 0;
-  /* change to the drive */
+
+  disk = getdisk();
   setdisk(drive);
-  if (getdisk() != drive)
+  if (getdisk() != disk)
   {
+    setdisk(disk);
     error_invalid_drive();
     return 1;
   }
+  setdisk(disk);
 
   /* get the media ID of the drive */
   media.info_level = 0;
-  r.x.bx = drive + 'A' - '@';
+  r.x.bx = drive + 1;
   r.x.cx = 0x866;
   s.ds = FP_SEG(&media);
   r.x.dx = FP_OFF(&media);
@@ -504,7 +313,7 @@
   /* print drive info */
   printf("\n Volume in drive %c", drive + 'A');
 
-  if (findfirst("\\*.*", &f, FA_LABEL) == 0)
+  if (FINDFIRST("\\*.*", &f, FA_LABEL) == 0)
   {
     printf(" is %s\n", f.ff_name);
   }
@@ -585,7 +394,7 @@
   /* print number of dirs and bytes free */
   printf("%9d dirs", dirs);
   r.h.ah = 0x36;
-  r.h.dl = drive + 'A' - '@';
+  r.h.dl = drive + 1;
   int86(0x21, &r, &r);
   convert((long)r.x.ax * r.x.bx * r.x.cx, buffer);
   if ((flags & DIR_RECURSE) == 0)
@@ -600,10 +409,8 @@
  *
  * list the files in the directory
  */
-int dir_list(int drive, char *directory, char *filespec, int *line,
-             unsigned flags)
+int dir_list(char *pathspec, int *line, unsigned flags)
 {
-  char *pathspec;
   char *ext;
   char buffer[32];
   struct ffblk file;
@@ -614,21 +421,11 @@
   int count;
   unsigned mode = FA_RDONLY | FA_ARCH | FA_DIREC;
 
-  if ((pathspec = malloc(MAXPATH)) == NULL)
-  {
-    MEM_ERR
-  }
-
   /* if the user wants all files listed RL 06/17/98 */
   if (flags & DIR_ALL)
     mode |= FA_HIDDEN | FA_SYSTEM;
 
-  if (directory[strlen(directory) - 1] == '\\')
-    sprintf(pathspec, "%c:%s%s", drive + 'A', directory, filespec);
-  else
-    sprintf(pathspec, "%c:%s\\%s", drive + 'A', directory, filespec);
-
-  if (findfirst(pathspec, &file, mode) != 0)
+  if (FINDFIRST(pathspec, &file, mode) != 0)
   {
     /* Don't want to print anything if scanning recursively
      * for a file. RL
@@ -637,12 +434,10 @@
     {
       error_file_not_found();
       incline(line, flags);
-      free(pathspec);
       return 1;
     }
     return 0;
   }
-  free(pathspec);
 
   /* moved down here because if we are recursively searching and
    * don't find any files, we don't want just to print
@@ -652,7 +447,7 @@
    */
   if ((flags & DIR_BARE) == 0)
   {
-    printf(" Directory of %c:%s\n", drive + 'A', directory);
+    printf(" Directory of %s\n", pathspec);
     if (incline(line, flags) != 0)
       return 1;
     printf("\n");
@@ -669,7 +464,7 @@
     if (flags & DIR_LWR)
       strlwr(file.ff_name);
 
-    if (flags & DIR_WIDE && (flags & DIR_BARE) == 0)
+    if (flags & DIR_WIDE && !(flags & DIR_BARE))
     {
       if (file.ff_attrib & FA_DIREC)
       {
@@ -701,7 +496,7 @@
       if (flags & DIR_RECURSE)
       {
         char dir[128];
-        sprintf(dir, "%c:%s\\", drive + 'A', directory);
+        sprintf(dir, "%s", pathspec);
         if (flags & DIR_LWR)
           strlwr(dir);
         printf(dir);
@@ -759,7 +554,7 @@
     if (cbreak)
       return 1;
   }
-  while (findnext(&file) == 0);
+  while (FINDNEXT(&file) == 0);
 
 /* Rob Lake, need to make clean output */
 /* JPP 07/08/1998 added check for count != 0 */
@@ -776,7 +571,7 @@
     recurse_file_cnt += filecount;
     recurse_bytes += bytecount;
     /* The code that was here is now in print_summary */
-    if (print_summary(drive, filecount, dircount,
+    if (print_summary(pathspec[0] - 'A', filecount, dircount,
                       bytecount, flags, line) != 0)
       return 1;
   }
@@ -788,109 +583,172 @@
   return 0;
 }
 
-/*
- * Read_Dir: Actual function that does recursive listing
- */
-int Read_Dir(int drive, char *parent, char *filespec, int *lines,
-             unsigned flags)
-{
-  DIR *dir;
-  struct dirent *ent;
-
-  if ((dir = opendir(parent)) == NULL)
-    return 1;
+///*
+// * Read_Dir: Actual function that does recursive listing
+// */
+//int Read_Dir(int drive, char *parent, char *filespec, int *lines,
+//             unsigned flags)
+//{
+//  DIR *dir;
+//  struct dirent *ent;
+//
+//  if ((dir = opendir(parent)) == NULL)
+//    return 1;
+//
+//  strupr(parent);
+//  if (parent[strlen(parent) - 1] == '\\')
+//    parent[strlen(parent) - 1] = '\0';
+//
+//  while ((ent = readdir(dir)) != NULL && !cbreak)
+//  {
+//    char buffer[128];
+//    struct stat stbuf;
+//    if (strcmp(ent->d_name, ".") == 0)
+//      continue;
+//    if (strcmp(ent->d_name, "..") == 0)
+//      continue;
+//    sprintf(buffer, "%s\\%s", parent, ent->d_name);
+//    /* changed call to _chmod to a call to stat,
+//     * faster? or is it another interrupt call?
+//     */
+//    if (stat(buffer, &stbuf) == -1)
+//      return 1;
+//    if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
+//    {
+//      if (dir_list(drive, buffer, filespec, lines, flags) != 0)
+//      {
+//        closedir(dir);
+//        return 1;
+//      }
+//      /* RL: This caused blanks lines being printed..
+//         if ((flags & DIR_BARE) == 0)
+//         {
+//         printf("\n");
+//         if (incline(lines, flags) != 0)
+//         return 1;
+//         } */
+//      if (chdir(buffer) == -1)
+//      {
+//        closedir(dir);
+//        return 1;
+//      }
+//      if (Read_Dir(drive, buffer, filespec, lines, flags) == 1)
+//      {
+//        closedir(dir);
+//        return 1;
+//      }
+//      chdir("..");
+//    }
+//  }
+//
+//  if (closedir(dir) != 0)
+//    return 1;
+//  return 0;
+//}
 
-  strupr(parent);
-  if (parent[strlen(parent) - 1] == '\\')
-    parent[strlen(parent) - 1] = '\0';
+///*
+// * do_recurse: Sets up for recursive directory listing
+// */
+//int do_recurse(int drive, char *directory, char *filespec,
+//               int *line, unsigned flags)
+//{
+//  char cur_dir[MAXDIR];
+//
+//  recurse_dir_cnt = recurse_file_cnt = recurse_bytes = 0L;
+//  setdisk(drive);
+//  getcwd(cur_dir, sizeof(cur_dir));
+//
+//  if (chdir(directory) == -1)
+//    return 1;
+//  if (dir_print_header(drive, line, flags) != 0 || cbreak)
+//    return 1;
+//  if (dir_list(drive, directory, filespec, line, flags) != 0)
+//    return 1;
+//  if ((flags & DIR_BARE) == 0)
+//  {
+//    printf("\n");
+//    if (incline(line, flags) != 0)
+//      return 1;
+//  }
+//  if (Read_Dir(drive, directory, filespec, line, flags) != 0)
+//    return 1;
+//  if ((flags & DIR_BARE) == 0)
+//    printf("\nTotal files listed:\n");
+//  flags &= ~DIR_RECURSE;
+//  if (print_summary(drive, recurse_file_cnt,
+//                    recurse_dir_cnt, recurse_bytes, flags, line) != 0)
+//    return 1;
+//  if ((flags & DIR_BARE) == 0)
+//  {
+//    printf("\n");
+//    if (incline(line, flags) != 0)
+//      return 1;
+//  }
+//  chdir(cur_dir);
+//  return 0;
+//}
+//
+//
+//
 
-  while ((ent = readdir(dir)) != NULL && !cbreak)
-  {
-    char buffer[128];
-    struct stat stbuf;
-    if (strcmp(ent->d_name, ".") == 0)
-      continue;
-    if (strcmp(ent->d_name, "..") == 0)
-      continue;
-    sprintf(buffer, "%s\\%s", parent, ent->d_name);
-    /* changed call to _chmod to a call to stat,
-     * faster? or is it another interrupt call?
-     */
-    if (stat(buffer, &stbuf) == -1)
+/* looks for wildcards in a path.  Returns 1 if any are found,
+   else returns 0 */
+int wildcards(char *path)
+{
+  if (strchr(path, '*'))
       return 1;
-    if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
-    {
-      if (dir_list(drive, buffer, filespec, lines, flags) != 0)
-      {
-        closedir(dir);
+  if (strchr(path, '?'))
         return 1;
-      }
-      /* RL: This caused blanks lines being printed..
-         if ((flags & DIR_BARE) == 0)
+  return 0;
+}
+
+char *fullfilespec(const char *path, char *newpath)
+{
+  char drive[MAXDRIVE];
+  char dir[MAXDIR];
+  char fname[MAXFILE];
+  char ext[MAXEXT];
+  struct ffblk ffblk;
+
+  _fullpath(newpath, path, MAXPATH);
+
+//  printf("Fullpath = %s\n",newpath);
+
+  if (!wildcards(newpath))
          {
-         printf("\n");
-         if (incline(lines, flags) != 0)
-         return 1;
-         } */
-      if (chdir(buffer) == -1)
+//    printf("no wildcards.\n");
+    if (findfirst(newpath, &ffblk, FA_DIREC | FA_ARCH) == 0)
       {
-        closedir(dir);
-        return 1;
-      }
-      if (Read_Dir(drive, buffer, filespec, lines, flags) == 1)
+//      printf("findfirst returned 0; attrib=%d\n",ffblk.ff_attrib);
+      //      printf("name = %s\n",ffblk.ff_name);
+      if (ffblk.ff_attrib & FA_DIREC)
       {
-        closedir(dir);
-        return 1;
+        strcat(newpath, "\\");
       }
-      chdir("..");
     }
   }
+//  printf("Fullpath = %s\n",newpath);
 
-  if (closedir(dir) != 0)
-    return 1;
-  return 0;
-}
-
-/*
- * do_recurse: Sets up for recursive directory listing
- */
-int do_recurse(int drive, char *directory, char *filespec,
-               int *line, unsigned flags)
-{
-  char cur_dir[MAXDIR];
+  _splitpath(newpath, drive, dir, fname, ext);
 
-  recurse_dir_cnt = recurse_file_cnt = recurse_bytes = 0L;
-  setdisk(drive);
-  getcwd(cur_dir, sizeof(cur_dir));
+//  printf("drive = %s\n",drive);
+  //  printf("dir = %s\n",dir);
+  //  printf("name = %s\n",fname);
+  //  printf("ext = %s\n",ext);
 
-  if (chdir(directory) == -1)
-    return 1;
-  if (dir_print_header(drive, line, flags) != 0 || cbreak)
-    return 1;
-  if (dir_list(drive, directory, filespec, line, flags) != 0)
-    return 1;
-  if ((flags & DIR_BARE) == 0)
+  if (!*fname && !*ext)
   {
-    printf("\n");
-    if (incline(line, flags) != 0)
-      return 1;
+    strcpy(fname, "*");
+    strcpy(ext, ".*");
   }
-  if (Read_Dir(drive, directory, filespec, line, flags) != 0)
-    return 1;
-  if ((flags & DIR_BARE) == 0)
-    printf("\nTotal files listed:\n");
-  flags &= ~DIR_RECURSE;
-  if (print_summary(drive, recurse_file_cnt,
-                    recurse_dir_cnt, recurse_bytes, flags, line) != 0)
-    return 1;
-  if ((flags & DIR_BARE) == 0)
+
+  if (!*fname)
   {
-    printf("\n");
-    if (incline(line, flags) != 0)
-      return 1;
+    strcpy(fname, "*");
   }
-  chdir(cur_dir);
-  return 0;
+
+  _makepath(newpath, drive, dir, fname, ext);
+  return newpath;
 }
 
 /*
@@ -905,13 +763,10 @@
   char *param;
   char *dircmd;
   int line = 0;
-  int drive;
-  int orig_drive;
-  char *directory;
-  char *filespec;
-  char orig_dir[MAXDIR];
   int rv;                       /* return value */
 
+  char path[MAXPATH];
+
   /* read the parameters from env */
   dircmd = getEnv("DIRCMD");
   if (dir_read_param(dircmd, &param, &flags) != 0)
@@ -924,32 +779,16 @@
   if (!param)
     param = ".";
 
-  if (strchr(param, '/'))
-    param = strtok(param, "/");
-
-  /* save the current directory info */
-  orig_drive = getdisk();
-  getcwd(orig_dir, sizeof(orig_dir));
+  fullfilespec(param, path);
 
   rv = 1;                       /* failed */
-  /* parse the directory info */
-  if (dir_parse_pathspec(param, &drive, &directory, &filespec) != 0)
-    goto ret;
-  if (flags & DIR_RECURSE)
-  {
-    incline(&line, flags);
-    rv = do_recurse(drive, directory, filespec, &line, flags);
-    goto ret;
-  }
   /* print the header */
-  if (dir_print_header(drive, &line, flags) != 0)
+  if (dir_print_header(path[0] - 'A', &line, flags) != 0)
     goto ret;
 
-  rv = dir_list(drive, directory, filespec, &line, flags);
+  rv = dir_list(path, &line, flags);
 
 ret:
-  setdisk(orig_drive);
-  chdir(orig_dir);
 
   return rv;
 }
Only in com075f: dirold.c
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/docs/bugs.txt com075f/docs/bugs.txt
--- com075e/docs/bugs.txt	Thu Nov 19 21:20:22 1998
+++ com075f/docs/bugs.txt	Mon Sep 14 00:21:56 1998
@@ -6,9 +6,6 @@
 MSDOS does not create an initial environment, so command.com has to
 do it.  It does not.
 
-Update from John Price: It seems to boot OK with MSDOS, but it does
-not work with FreeDOS.  Can't create environment.
-
 When switching to a drive with no disk in it, it doesn't notice, and
 you get garbage.
 
Only in com075f/docs: copy.txt
Files com075e/docs/files.txt and com075f/docs/files.txt are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/docs/history.txt com075f/docs/history.txt
--- com075e/docs/history.txt	Thu Nov 19 14:46:48 1998
+++ com075f/docs/history.txt	Thu Dec  3 15:35:14 1998
@@ -372,3 +372,24 @@
 ~~~~~~~~~~~~~~~~~~~~~~
 o command.c: changed line in is_delim function to include backslash
   and period.
+
+03-Dec-1998 0.75d (John P. Price <linux-guru@gcfl.net>)
+~~~~~~~~~~~~~~~~~~~~~~
+o alias.c: changed to convert to lower case instead of upper
+o cls.c: cls now sets the text colors to lightgray on black before
+  clearing the screen.
+o command.c: Added code to remove white space from end of command in
+  docommand function.  Also added nextcmd char pointer so we don't
+  loose the other commands in the line.  This fixes the bug
+  with "type filename.c | more"
+o dir.c: Rewrote DIR command.  fixed problem with "DIR .COM" and
+  other bugs. Recursive switch does not work now, but it will be
+  added soon.
+o init.c: finished batch file trace mode.  Fixed bug with /C command
+  line switch running batch files.
+  Added about 2 second delay where user can press F8 to run
+  autoexec.bat in tracemode, or press F5 to bypass autoexec.bat
+  completely.
+o messages.c: Reduced the ammount of memory allocated by not reading
+  in entire index, but only the index element needed.
+
Files com075e/docs/license.txt and com075f/docs/license.txt are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/docs/notes.txt com075f/docs/notes.txt
--- com075e/docs/notes.txt	Thu Nov 19 21:18:08 1998
+++ com075f/docs/notes.txt	Mon Sep 14 00:21:58 1998
@@ -113,72 +113,4 @@
   them, however).
 
 -----------------------------------------------------------------------------
-COPY.TXT
-Rob Lake
-Aug-19-98
-
-Notes:
-o Crashes when returning from cmd_copy.  Works fine on its own
-(see mod_copy.zip).  I can't figure out why myself.  I think that
-there is a memory allocation problem somewhere.  Hopefully someone
-more experienced can track it down.
-
-o I named the module version of copy `cp' to resolve possible abiguity of
-naming it copy.
-
-o I don't remember exactly what time I started writing, so I figured around
-Aug 1.
-
-o Although the program accepts the /Y or /-Y switches, it does not do
-anything with them, yet.
-
-o The default mode for copying is BINARY
-
-o Specify /a before or after the destination file, if one is given,
-will append the destination with a ^Z character.  Place appropriate
-warning here.  Ex. These commands will add the ^Z character:
-        cp "/a cp.com cp.txt"
-        cp "cp.com + /a cp.obj cp.txt"
-        cp "cp.com /a cp.txt"
-        cp "cp.com cp.txt /a"
-
-o You can define the mode for all files in the command line.  Ex.
-        cp "/b cp.com + /a copy.c + /a copy.obj /b cp.txt"
-works (for whatever reason someone would want to do that:-).
-
-o The following commands where tested with the module copy:
-        cp c:\autoexec.bat
-        cp "c:\autoexec.bat test.bat"
-        cp "..\ temp"
-- Given that ..\ has files.  If temp is a directory, will copy all files
-to it.  If temp is a file or does not exist, all the files with be copied
-to .\temp.  NOTE: Appended to temp, not over written each time.
-        cp "cp.com test.com"
-        cp "/a cp.com cp.txt"
-        cp "file1+file2+file3 file4"
-- Will ask to overwrite file4 after file1 has been copied.  This will be
-fixed later.
-        cp "file5+file1+file2+file3"
-- This appends file1, file2 and file3 to file5.  Will ask to overwrite
-file5 when file2 has been copied, if file5 does not exist.  Will be fixed
-later.
-- MS-DOS copy doesn't create file5 if it does not exist.  It
-concatenates all to file1, it should print an error message.  This copy
-creates a file5 if one does not exist.  This can be changed later.
-
-o This command doesn't work yet:
-        cp "*.c+*.h *.txt"
-- If tried, will print "NOT IMPLEMENTED YET" message.  This command may be
-kind of confusing.  Take for example you have a directory with these files:
-file1.c file1.h
-file2.c file2.h
-The command above will copy file1.c and file1.h to file1.txt and file2.c
-and file2.h to file2.txt.  If, say, file1.h does not exist, copy will
-produce the messages:
-FILE1.C
-FILE1.H
-File not found - FILE1.H
-Invalid handle - FILE1.TXT
-        0 file(s) copied
------------------------------------------------------------------------------
 
Files com075e/docs/readme.txt and com075f/docs/readme.txt are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/docs/todo.txt com075f/docs/todo.txt
--- com075e/docs/todo.txt	Thu Nov 19 21:17:02 1998
+++ com075f/docs/todo.txt	Mon Sep 14 00:21:58 1998
@@ -11,9 +11,15 @@
 
 ^S and ^Q to pause/resume displays.
 
-Finish COPY command.
+COPY, BREAK commands on command-line.
 
-Does not create environment correctly when booting from FreeDOS.
+Fix environment handling, probably using Steffan Kaiser's library.
 
 Add wildcard support to REN.
+
+Make every command respond to "/?".
+
+Move all text to another file or end of COM file, and only load it
+into memory when it is necessary.  This would help to support
+multiple languages.
 
Files com075e/echo.c and com075f/echo.c are identical
Files com075e/environ.c and com075f/environ.c are identical
Files com075e/err_hand.c and com075f/err_hand.c are identical
Files com075e/err_hand.h and com075f/err_hand.h are identical
Files com075e/errno.h and com075f/errno.h are identical
Files com075e/error.c and com075f/error.c are identical
Only in com075f: exe2bin.com
Files com075e/exec.c and com075f/exec.c are identical
Files com075e/fdcom.ico and com075f/fdcom.ico are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/ffind.c com075f/ffind.c
--- com075e/ffind.c	Mon Sep 14 00:21:52 1998
+++ com075f/ffind.c	Tue Dec  1 12:59:20 1998
@@ -127,8 +127,7 @@
 /*
  *  Convert LFN style struct ffblk into DOS style
  */
-static void
-  convLFN(struct ffblk *ff)
+static void convLFN(struct ffblk *ff)
 {
   if (*ff->ff_lfn.ff_shortname) /* shortname present */
     memcpy(ff->ff_name, ff->ff_lfn.ff_shortname, sizeof(ff->ff_name));
@@ -143,8 +142,7 @@
  *  findfirst() for the LFN API
  *  On success the non-LFN portion is updated with the LFN data.
  */
-static int
-  findLFN(char *name
+static int findLFN(char *name
           ,struct ffblk *ff
           ,int attr)
 {
@@ -173,8 +171,7 @@
  *  findnext() for the LFN API
  *  On success the non-LFN portion is updated with the LFN data.
  */
-static int
-  nextLFN(struct ffblk *ff)
+static int nextLFN(struct ffblk *ff)
 {
   struct REGPACK r;
   REG int err;
@@ -206,8 +203,7 @@
  *    == 0: OK a match found
  *    != 0: failure; OS error code
  */
-_CLibFunc int
-  findfirst(char *name
+_CLibFunc int findfirst(char *name
             ,struct ffblk *ff
             ,int attr)
 {
Only in com075f: file_id.diz
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/filecomp.c com075f/filecomp.c
--- com075e/filecomp.c	Mon Sep 14 00:21:52 1998
+++ com075f/filecomp.c	Tue Dec  1 13:12:30 1998
@@ -20,6 +20,8 @@
 #include <dir.h>
 #include <dos.h>
 
+#include "command.h"
+
 #define D_BEEP    putchar('\a')
 
 void goxy(unsigned char x, unsigned char y);
@@ -89,7 +91,7 @@
 
   curplace = 0;                 // current fname
 
-  if (findfirst(path, &file, 0x3F) == 0)
+  if (FINDFIRST(path, &file, 0x3F) == 0)
   {                             // find anything
 
     do
@@ -121,7 +123,7 @@
           }
       }
     }
-    while (findnext(&file) == 0);
+    while (FINDNEXT(&file) == 0);
 
     strcpy(&str[start], directory);
     strcat(&str[start], maxmatch);
@@ -188,7 +190,7 @@
 
   curplace = 0;                 // current fname
 
-  if (findfirst(path, &file, 0x3F) == 0)
+  if (FINDFIRST(path, &file, 0x3F) == 0)
   {                             // find anything
 
     putchar('\n');
@@ -211,7 +213,7 @@
         count = 0;
       }
     }
-    while (findnext(&file) == 0);
+    while (FINDNEXT(&file) == 0);
 
     if (count)
       putchar('\n');
Files com075e/fixstrs.bat and com075f/fixstrs.bat are identical
Files com075e/for.c and com075f/for.c are identical
Files com075e/goto.c and com075f/goto.c are identical
Files com075e/history.c and com075f/history.c are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/if.c com075f/if.c
--- com075e/if.c	Mon Sep 14 00:21:52 1998
+++ com075f/if.c	Tue Dec  1 13:03:50 1998
@@ -70,7 +70,7 @@
 
       *pp++ = '\0';
 
-      x_flag ^= findfirst(param, &f, FA_NORMAL) ? 0 : X_EXEC;
+      x_flag ^= FINDFIRST(param, &f, FA_NORMAL) ? 0 : X_EXEC;
     }
     else
       return 0;
Files com075e/indent.pro and com075f/indent.pro are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/init.c com075f/init.c
--- com075e/init.c	Mon Sep 14 00:21:56 1998
+++ com075f/init.c	Thu Dec  3 15:01:52 1998
@@ -9,6 +9,13 @@
  *
  * 09-Sep-1998 ska
  * - fix/chg: ^Break handler now handles external programs properly
+ *
+ * 01-Dec-1998 jpp
+ * - finished batch file trace mode.  Fixed bug with /C command line switch
+ *   running batch files
+ * - Added about 2 second delay where user can press F8 to run autoexec.bat
+ *   in tracemode, or press F5 to bypass autoexec.bat completely.
+ *
  */
 
 #include "config.h"
@@ -29,13 +36,16 @@
 #include "strings.h"
 
 /* Name of the executable */
-#ifdef __TINY__
+//#ifdef __TINY__
 #define COM_NAME "COMMAND.COM"
-#else
-#define COM_NAME "COMMAND.EXE"
-#endif
+//#else
+//#define COM_NAME "COMMAND.EXE"
+//#endif
+
+extern int aliasload(char *, char *);
 
 static unsigned oldPSP;
+char *ComDir;                   //this is the directory command.com is in.
 
 /* Without resetting the owner PSP, the program is not removed
    from memory by the DOS boxes of Win98 & WinNT4 (others not tested) */
@@ -85,6 +95,41 @@
   putchar('\n');
 }
 
+/* Waits about 2 secs for a keypress.
+   returns 0 if none else returns key pressed.
+ */
+
+int WaitForFkeys(void)
+{
+  struct time start,
+    now;
+  int secs = 3;
+  int ch;
+
+  gettime(&start);
+
+  while (secs)
+  {
+    gettime(&now);
+    if (now.ti_sec != start.ti_sec)
+    {
+      gettime(&start);
+      secs--;
+    }
+    if (kbhit())
+    {
+      if ((ch = getch()) == 0)
+        ch = getch() + 256;
+//      printf("key pressed = %d\n",ch);
+      return ch;
+    }
+  }
+  return 0;
+}
+
+#define KEY_F5   319
+#define KEY_F8   322
+
 /*
  * set up global initializations and process parameters
  *
@@ -102,13 +147,16 @@
  */
 
 #pragma argsused
-void initialize(int argc, char *argv[])
+int initialize(int argc, char *argv[])
 {
   char *comPath;                /* path to COMMAND.COM (for COMSPEC/reload) */
   char *newTTY;                 /* what to change TTY to */
   unsigned envSize;             /* minimum environment size (/E:) */
   int loadMSGs;                 /* load messages permanent into memory (/MSG) */
   int spawnCmd;                 /* spawn command (/C or /K) */
+  int showhelp;                 /* show help /? */
+  int showinfo;                 /* show initial info only if no command line options */
+  int key;
 
   char *argv0;
   char *p;
@@ -124,9 +172,6 @@
   extern void initCBreakCatcher(void);
   initCBreakCatcher();
 
-  short_version();
-  putchar('\n');
-
   /* Install INT 24 Critical error handler */
   init_error_handler();
 
@@ -145,7 +190,8 @@
 /* Now parse the command line parameters passed to COMMAND.COM */
   /* Preparations */
   comPath = newTTY = NULL;
-  loadMSGs = tracemode = spawnCmd = 0;
+  loadMSGs = tracemode = spawnCmd = showhelp = 0;
+  showinfo = 1;
 
   /*JPP added 128 to size so that we can add COMSPEC and other variables */
   envSize = env_resize(0, 0) + 128;
@@ -187,6 +233,7 @@
           if (*q)
             goto unknown;
           spawnCmd = toupper(q[-1]);
+          showinfo = 0;
           break;
 
         case 'E':
@@ -231,6 +278,12 @@
           if (*q)
             goto unknown;
           tracemode = 1;
+          showinfo = 0;
+          break;
+
+        case '?':
+          showhelp = 1;
+          showinfo = 0;
           break;
 
         default:
@@ -296,9 +349,18 @@
   q = argv0;
 
 comFound:
-  if (chgEnv("COMSPEC", q))
+  comPath = _fullpath(NULL, q, 0);
+  ComDir = strdup(comPath);
+
+  q = strrchr(ComDir, '\\');
+  if (q)
+    *++q = 0;
+
+  if (chgEnv("COMSPEC", comPath))
     error_env_var("COMSPEC");
 
+  free(comPath);
+
   /* Here the messages had to be loaded, the filename is in 'p' */
   if (loadMSGs)
   {
@@ -306,11 +368,29 @@
     puts("The /MSG option has no effect, yet.");
   }
 
+#ifdef FEATURE_ALIASES
+  aliasload(ComDir, "ALIAS.SYS");
+#endif
+
   /* Now the /P option can be processed */
   if (!canexit)
   {
-    if (exist("\\autoexec.bat"))
-      parsecommandline("\\autoexec.bat");
+    key = WaitForFkeys();
+
+    if (key == KEY_F8)
+    {
+      tracemode = 1;
+      showinfo = 0;
+    }
+
+    if (key == KEY_F5)
+    {
+      printf("Bypassing AUTOEXEC.BAT file.\n");
+    }
+    else
+    {
+      if (exist("\\AUTOEXEC.BAT"))
+        parsecommandline("\\AUTOEXEC.BAT");
     else
     {
 #ifdef INCLUDE_CMD_DATE
@@ -321,6 +401,7 @@
 #endif
     }
   }
+  }
 
   /* Now the /C or /K option can be processed */
   if (spawnCmd)
@@ -330,17 +411,21 @@
     while ((p = *++argv) != NULL)
     {
       *q = ' ';
-      q = stpcpy(q + 1, p);
+      stpcpy(q + 1, p);
     }
 
     parsecommandline(buf + 1);
 
     if (spawnCmd != 'K')
-      exit(0);                  /* DOS shells always return OK, how stupid this is, however */
+      return 1;
   }
 
-/* entering the interactive mode */
-  tracemode = 0;
-
+  if (showinfo)
+  {
+    short_version();
+    putchar('\n');
   showcmds();
+  }
+
+  return 0;
 }
Files com075e/internal.c and com075f/internal.c are identical
Files com075e/lh.asm and com075f/lh.asm are identical
Files com075e/loadhigh.asm and com075f/loadhigh.asm are identical
Files com075e/loadhigh.c and com075f/loadhigh.c are identical
Files com075e/loadhigh.h and com075f/loadhigh.h are identical
Files com075e/lowexec.asm and com075f/lowexec.asm are identical
Files com075e/makecom.bat and com075f/makecom.bat are identical
Only in com075f: makedist.bat
Files com075e/makefile.bcc and com075f/makefile.bcc are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/makefile.tcc com075f/makefile.tcc
--- com075e/makefile.tcc	Thu Nov 19 20:59:54 1998
+++ com075f/makefile.tcc	Mon Aug 10 06:22:06 1998
@@ -6,7 +6,7 @@
 TLIB = tlib
 TLINK = tlink
 LIBPATH = C:\TC\LIB
-INCLUDEPATH = C:\TC\INCLUDE;..\SUPPL\INCLUDE;..\SUPPL\LIB\SUPPL
+INCLUDEPATH = C:\TC\INCLUDE
 
 
 #		*Implicit Rules*
@@ -58,23 +58,15 @@
  shift.obj \
  path.obj \
  cls.obj \
- break.obj \
  verify.obj \
  datefunc.obj \
  timefunc.obj \
- filecomp.obj \
- init.obj \
- ctty.obj \
- copy.obj \
- messages.obj \
- cb_catch.obj \
- tmpnam.obj \
- {$(LIBPATH)}suppl_s.lib
+ filecomp.obj
 
 #		*Explicit Rules*
 command.exe: command.cfg $(EXE_dependencies)
-  $(TLINK) /s/n/c/L$(LIBPATH) @&&|
-c0s.obj+
+  $(TLINK) /x/L$(LIBPATH) @&&|
+c0t.obj+
 alias.obj+
 batch.obj+
 cmdinput.obj+
@@ -113,19 +105,12 @@
 shift.obj+
 path.obj+
 cls.obj+
-break.obj+
 verify.obj+
 datefunc.obj+
 timefunc.obj+
-filecomp.obj+
-init.obj+
-ctty.obj+
-copy.obj+
-messages.obj+
-cb_catch.obj+
-tmpnam.obj
-command,command
-suppl_s.lib+
+filecomp.obj
+command
+		# no map file
 cs.lib
 |
 
@@ -209,8 +194,6 @@
 
 cls.obj: command.cfg cls.c 
 
-break.obj: command.cfg break.c 
-
 verify.obj: command.cfg verify.c 
 
 datefunc.obj: command.cfg datefunc.c 
@@ -219,22 +202,10 @@
 
 filecomp.obj: command.cfg filecomp.c 
 
-init.obj: command.cfg init.c 
-
-ctty.obj: command.cfg ctty.c 
-
-copy.obj: command.cfg copy.c 
-
-messages.obj: command.cfg messages.c 
-
-cb_catch.obj: command.cfg cb_catch.asm 
-	$(TASM) /MX /ZI /O CB_CATCH.ASM,CB_CATCH.OBJ
-
-tmpnam.obj: command.cfg tmpnam.c 
-
 #		*Compiler Configuration File*
 command.cfg: command.mak
   copy &&|
+-mt
 -a
 -f-
 -ff-
@@ -245,13 +216,10 @@
 -Z
 -k-
 -d
--h
--b-
+-vi-
 -H=COMMAND.SYM
--Vf
 -I$(INCLUDEPATH)
 -L$(LIBPATH)
--Ff
 | command.cfg
 
 
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/messages.c com075f/messages.c
--- com075e/messages.c	Thu Nov 19 11:59:52 1998
+++ com075f/messages.c	Thu Dec  3 15:02:30 1998
@@ -1,3 +1,18 @@
+/*
+ * MESSAGES.C - Read messages from strings database located in a file or
+ *              at the end of command.com
+ *
+ *
+ * Comments:
+ *
+ * 27 Jul 1998  John P. Price
+ * - started.
+ *
+ * 03-Dec-1998  John P. Price
+ * - Reduced the ammount of memory allocated by not reading in entire index,
+ *   but only the index element needed.
+ *
+ */
 
 //#define READ_FROM_FILE
 
@@ -6,6 +21,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <alloc.h>
+#include <dir.h>
 
 #include "command.h"
 #include "strings.h"
@@ -25,8 +41,9 @@
   char *theid = STRINGS_ID;
   char *thisstr;
 
-  unsigned segs,
-    offs;
+  unsigned segs;
+  unsigned offs;
+  unsigned long offset;
 
   if (id >= NUMBER_OF_STRINGS)
   {
@@ -35,25 +52,47 @@
   }
 
 #ifdef READ_FROM_FILE
-  if ((f = fopen("strings.dat", "rb")) == NULL)
+  if ((thisstr = malloc(MAXPATH)) == NULL)
+  {
+    printf("Out of memory accessing strings.dat file.\n");
+    return;
+  }
+  strcpy(thisstr, ComDir);
+  strcat(thisstr, "STRINGS.DAT");
+  if ((f = fopen(thisstr, "rb")) == NULL)
   {
     perror("Can not access strings.dat!");
+    free(thisstr);
     return;
   }
+  free(thisstr);
 
+  offset = 0;
 #else
   if ((f = fopen(getEnv("COMSPEC"), "rb")) == NULL)
   {
-    perror("Can not read strings from COMMAND.COM!");
+    if ((thisstr = malloc(MAXPATH)) != NULL)
+    {
+      strcpy(thisstr, ComDir);
+      strcat(thisstr, "COMMAND.COM");
+      if ((f = fopen(thisstr, "rb")) == NULL)
+      {
+        perror("Can not open COMMAND.COM to read strings!");
+        free(thisstr);
+        return;
+      }
+      free(thisstr);
+    }
+    else
     return;
   }
 
 //  printf("%s opened.\n",getEnv("COMSPEC"));
 
   fread(fdid, 2, 1, f);
-  if (strncmp(fdid, "MZ", 2))
+  if (fdid[0] != 'M' || fdid[1] != 'Z')
   {
-    printf("COMMAND.COM not a valid EXE file!\n");
+    printf("COMMAND.COM not a valid EXE file (MZ not found)!\n");
     fclose(f);
     return;
   }
@@ -66,10 +105,12 @@
   if (offs != 0)
     segs--;
 
-//  printf("seeking to %lu...\n",(long)segs * 512 + offs);
-  fseek(f, (long)segs * 512 + offs, SEEK_SET);
+  offset = (long)segs *512 + offs;
+  printf("offset = %lu\n", offset);
 
-//  printf("memory = %u\n",coreleft());
+  fseek(f, offset, SEEK_SET);
+
+  printf("memory = %u\n", coreleft());
 
 #endif
 
@@ -78,14 +119,13 @@
   if (strncmp(fdid, theid, strlen(STRINGS_ID)))
   {
     printf("Strings ID not valid!\n");
-    /* This will display garbage (BEEP! BEEP! etc.) on screen
-    fdid[strlen(theid)] = '\0';
-    puts(fdid);			-- 1998/10/27 ska*/
     fclose(f);
     return;
   }
 
-  if ((string_index = malloc(NUMBER_OF_STRINGS * sizeof(struct indextype))) == NULL)
+  offset += strlen(theid);
+
+  if ((string_index = malloc(sizeof(struct indextype))) == NULL)
   {
     printf("Out of memory reading string index in.\n");
     fclose(f);
@@ -93,10 +133,14 @@
   }
 
 //  printf("Reading %u bytes of string index in...",NUMBER_OF_STRINGS * sizeof(unsigned));
-  fread(string_index, sizeof(struct indextype), NUMBER_OF_STRINGS, f);
-//  printf("done!\n");
+  //  fread(string_index, sizeof(struct indextype), NUMBER_OF_STRINGS, f);
+  //  printf("done!\n");
 
-  if ((thisstr = malloc(string_index[id].size)) == NULL)
+  //read index value into string_index
+  fseek(f, id * sizeof(struct indextype), SEEK_CUR);
+  fread(string_index, sizeof(struct indextype), 1, f);
+
+  if ((thisstr = malloc(string_index->size)) == NULL)
   {
     printf("Out of memory reading string in.\n");
     free(string_index);
@@ -104,16 +148,19 @@
     return;
   }
 
-  fseek(f, string_index[id].index, SEEK_CUR);
+  offset += NUMBER_OF_STRINGS * sizeof(struct indextype);
+
+  fseek(f, string_index->index + offset, SEEK_SET);
 //  printf("Reading %u bytes of string in...",string_index[id].size);
-  fread(thisstr, string_index[id].size, 1, f);
+  fread(thisstr, string_index->size, 1, f);
 //  printf("done!\n");
 
+  free(string_index);
+
   fclose(f);
 
   va_start(argptr, id);
   vprintf(thisstr, argptr);
   va_end(argptr);
   free(thisstr);
-  free(string_index);
 }
Files com075e/misc.c and com075f/misc.c are identical
Files com075e/model.def and com075f/model.def are identical
Files com075e/path.c and com075f/path.c are identical
Files com075e/pause.c and com075f/pause.c are identical
Files com075e/prompt.c and com075f/prompt.c are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/redir.c com075f/redir.c
--- com075e/redir.c	Thu Nov 19 20:34:40 1998
+++ com075f/redir.c	Thu Dec  3 15:03:36 1998
@@ -38,13 +38,13 @@
 int get_redirection(char *s, char **ifn, char **ofn, int *ofatt)
 {
   /*
-   * Gets the redirection infor from the command line and copies the
+   * Gets the redirection info from the command line and copies the
    * file names into ifn and ofn removing them from the command line.
    * The names are allocated here and passed back to the caller, on
    * malloc() failure, -1 is returned. These names are trimmed,
    * meaning they do not contain any leading or trailing whitespaces.
    *
-   * Converts remainin command line into a series of null terminated
+   * Converts remaining command line into a series of null terminated
    * strings defined by the pipe char '|'. Each string corresponds
    * to a single executable command. A double null terminates the
    * command strings.
@@ -72,10 +72,10 @@
           char *p;
           int len;
 
+          /* If there is no closing quote, then go to end of line. */
           if ((p = strchr(sp, ch)) == NULL)
           {
-            error_close_quote(ch);
-            return -1;
+            p = sp + strlen(sp) - 1;
           }
 
           /* closing quote found, move that area */
@@ -93,8 +93,7 @@
           /* MS-DOS ignores multiple redirection symbols and uses the last */
           /* redirection, so we'll emulate that and not check */
 
-          char
-          **op = (ch == '<') ? ifn : ofn;
+          char **op = (ch == '<') ? ifn : ofn;
           char *p;
 
           if ((ch == '>') && (*sp == '>'))	/* Append request ? */
Files com075e/ren.c and com075f/ren.c are identical
Files com075e/set.c and com075f/set.c are identical
Files com075e/shift.c and com075f/shift.c are identical
Files com075e/strings/fixstrs.c and com075f/strings/fixstrs.c are identical
Files com075e/strings/fixstrs.exe and com075f/strings/fixstrs.exe are identical
Files com075e/strings/indent.pro and com075f/strings/indent.pro are identical
Files com075e/strings/strings.txt and com075f/strings/strings.txt are identical
Binary files com075e/strings.dat and com075f/strings.dat differ
Files com075e/strings.h and com075f/strings.h are identical
Files com075e/suppl_s.lib and com075f/suppl_s.lib are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/tempfile.c com075f/tempfile.c
--- com075e/tempfile.c	Thu Nov 19 21:35:36 1998
+++ com075f/tempfile.c	Thu Nov 19 11:59:18 1998
@@ -33,10 +33,8 @@
 
 void rmtmpfile(void)
 {
-  if (tfn)
-  {
-    if (tfp)
-    {
+	if(tfn) {
+	  if(tfp) {
       fclose(tfp);
       tfp = NULL;
     }
Files com075e/tempfile.h and com075f/tempfile.h are identical
Files com075e/tests/bat1.bat and com075f/tests/bat1.bat are identical
Files com075e/tests/bat2.bat and com075f/tests/bat2.bat are identical
Files com075e/tests/bat3.bat and com075f/tests/bat3.bat are identical
Files com075e/tests/dir-test.txt and com075f/tests/dir-test.txt are identical
Files com075e/tests/fdos.out and com075f/tests/fdos.out are identical
Files com075e/tests/hbp001a.bat and com075f/tests/hbp001a.bat are identical
Files com075e/tests/hbp001b.bat and com075f/tests/hbp001b.bat are identical
Files com075e/tests/hbp002.txt and com075f/tests/hbp002.txt are identical
Files com075e/tests/hbp_001.txt and com075f/tests/hbp_001.txt are identical
Files com075e/tests/msdos.out and com075f/tests/msdos.out are identical
Only in com075f/tests: refl.bat
Files com075e/tests/t.bat and com075f/tests/t.bat are identical
Files com075e/tests/test.bat and com075f/tests/test.bat are identical
Files com075e/tests/test1.bat and com075f/tests/test1.bat are identical
Files com075e/tests/test2.bat and com075f/tests/test2.bat are identical
Files com075e/tests/test3.bat and com075f/tests/test3.bat are identical
Files com075e/tests/test4.bat and com075f/tests/test4.bat are identical
Files com075e/tests/testenv.c and com075f/tests/testenv.c are identical
Files com075e/time.c and com075f/time.c are identical
Files com075e/timefunc.c and com075f/timefunc.c are identical
Files com075e/timefunc.h and com075f/timefunc.h are identical
Files com075e/tmpnam.c and com075f/tmpnam.c are identical
Files com075e/truename.c and com075f/truename.c are identical
Files com075e/type.c and com075f/type.c are identical
diff --recursive --ignore-space-change --unified --report-identical-files --minimal com075e/ver.c com075f/ver.c
--- com075e/ver.c	Thu Nov 19 13:06:50 1998
+++ com075f/ver.c	Tue Dec  1 12:52:54 1998
@@ -27,7 +27,7 @@
 #include "command.h"
 #include "strings.h"
 
-char *shellver = "version 0.75e\xE1 [" __DATE__ "]";
+char *shellver = "version 0.75f\xE1 [" __DATE__ "]";
 char *shellname = "FreeDOS Command Shell";
 
 void short_version(void)
Files com075e/verify.c and com075f/verify.c are identical
Only in com075e: vol.c
Files com075e/where.c and com075f/where.c are identical
