Files com074b/28.com and com074c/28.com are identical
Files com074b/alias.c and com074c/alias.c are identical
Files com074b/alias.h and com074c/alias.h are identical
Files com074b/batch.c and com074c/batch.c are identical
Files com074b/bugs.txt and com074c/bugs.txt are identical
Files com074b/clean.bat and com074c/clean.bat are identical
Files com074b/cmdinput.c and com074c/cmdinput.c are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/command.c com074c/command.c
--- com074b/command.c	Thu Jul 16 11:29:11 1998
+++ com074c/command.c	Thu Jul 16 11:29:11 1998
@@ -61,6 +61,9 @@
  *  07/09/1998 (John P. Price)
  *  - fixed call to spawnl so it would pass arguments correctly
  *
+ * 07/12/98 (Rob Lake)
+ *  - Changed error messages
+ *
  *
  */
 
@@ -79,20 +82,6 @@
 
 #include "command.h"
 
-/* define some error messages */
-#define SYNTAXERR       "ERROR: syntax error"
-#define NOENVERR        "ERROR: no environment"
-#define INVALIDDRIVE    "ERROR: invalid drive"
-#define INVALIDFUNCTION "ERROR: invalid function"
-#define BADCOMMAND      "ERROR: bad command or filename"
-#define FILENOTFOUND    "ERROR: file not found"
-#define ACCESSDENIED    "ERROR: access denied"
-#define NOTENOUGHMEMORY "ERROR: not enough memory"
-#define BADENVIROMENT   "ERROR: bad enviroment"
-#define BADFORMAT       "ERROR: bad format"
-#define ERROR_E2BIG     "ERROR: Argument list too long"
-#define ERROR_EINVAL    "ERROR: Invalid argument"
-
 /* define the internal commands */
 #define ALIAS   "alias"
 #define CD        "cd"
@@ -213,7 +202,8 @@
   /* search the PATH environment variable for the binary */
   if (!find_which(paths, first, fullname))
   {
-    fprintf(stderr, "%s\n", BADCOMMAND);
+    //fprintf(stderr, "%s\n", BADCOMMAND);
+    badcommand();
     return;
   }
 
@@ -234,8 +224,8 @@
     }
   }
 /*
- * else if ((r = exec(fullname, rest, EnvSeg)) != 0)
- * {
+ *else if ((r = exec(fullname, rest, EnvSeg)) != 0)
+ *{
  * switch (r)
  * {
  * case 1:
@@ -547,7 +537,8 @@
         close(oldoutfd);
 
         /* this might leave some temporary files around... oh well */
-        fprintf(stderr, "Error!  Cannot pipe!  Cannot open temporary file!\n");
+        //fprintf(stderr, "Error!  Cannot pipe!  Cannot open temporary file!\n");
+        no_pipe();
         close(outfd);
         return;
       }
@@ -592,7 +583,8 @@
         close(oldoutfd);
 
         /* might leave some temp files around */
-        fprintf(stderr, "Error!  Cannot pipe!  Cannot create temporary file!\n");
+        //fprintf(stderr, "Error!  Cannot pipe!  Cannot create temporary file!\n");
+        no_pipe();
         close(infd);
         close(outfd);
         return;
@@ -690,11 +682,19 @@
 
   ctrlbrk(c_brk);
 
+  init_error_handler();
+
   /* Added by Rob Lake 06/16/98.  This enables the command.com
    * to run the autoexec.bat at startup */
   if (argc >= 2)
     if (strcmpi(argv[1], "/p") == 0)
     {
+      if (!exist("\\autoexec.bat"))
+      {
+        cmd_date(NULL, NULL);
+        cmd_time(NULL, NULL);
+      }
+      else
       parsecommandline("\\autoexec.bat");
       canexit = 0;
     }
Binary files com074b/command.com and com074c/command.com differ
Binary files com074b/command.dsk and com074c/command.dsk differ
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/command.h com074c/command.h
--- com074b/command.h	Thu Jul 16 11:29:11 1998
+++ com074c/command.h	Thu Jul 16 11:29:11 1998
@@ -5,6 +5,10 @@
  *
  * 06/29/98 (Rob Lake)
  *      - Moved error messages in here
+ *
+ * 07/12/98 (Rob Lake)
+ * - Moved more error message here
+ *
  */
 
 #define EnvSeg (*(unsigned far*)MK_FP(_psp, 0x2c))
@@ -15,12 +19,27 @@
 #define BREAK_INPUT 3
 #define BREAK_IGNORE 4
 
-/* error messages */
+/* define some error messages */
+#define SYNTAXERR       "Syntax error"
+#define NOENVERR        "ERROR: no environment"
+#define INVALIDDRIVE    "ERROR: invalid drive"
+#define INVALIDFUNCTION "ERROR: invalid function"
+#define BADCOMMAND      "Bad command or filename"
+#define ACCESSDENIED    "ERROR: access denied"
+#define NOTENOUGHMEMORY "ERROR: not enough memory"
+#define BADENVIROMENT   "ERROR: bad enviroment"
+#define BADFORMAT       "ERROR: bad format"
+#define ERROR_E2BIG     "ERROR: Argument list too long"
+#define ERROR_EINVAL    "ERROR: Invalid argument"
+
+#define CANNOTPIPE      "Error!  Cannot pipe!  Cannot open temporary file!\n"
+
 #define TOO_MANY_PARAMETERS "Too many parameters - %s\n"
 #define INVALID_SWITCH "Invalid switch - /%c\n"
 #define PATH_NOT_FOUND "Path not found\n"
-#define FILE_NOT_FOUND "File not found\n"
+#define FILE_NOT_FOUND "File not found"
 #define REQ_PARAM_MISSING "Required parameter missing\n"
+#define INVALID_DRIVE "Invalid drive specification\n"
 
 /* prototypes for COMMAND.C */
 extern int ctrlBreak;
@@ -91,3 +110,24 @@
 int aliasswapout(void);
 int aliasswapin(void);
 int alias(char *, char *);
+
+/* Prototypes for ERR_HAND.C */
+void init_error_handler(void);
+void printstring(char *);
+char *get_err(unsigned);
+void interrupt far dos_critical_error(unsigned, unsigned, unsigned, unsigned,
+                          unsigned, unsigned, unsigned, unsigned, unsigned);
+
+/* Prototypes for MISC.C */
+int exist(char *);
+
+/* Prototypes for ERROR.C */
+void no_pipe(void);
+void badcommand(void);
+void invalid_drive(void);
+void req_param_missing(void);
+void sfile_not_found(char *);
+void file_not_found(void);
+void path_not_found(void);
+void too_many_parameters(char *);
+void invalid_switch(char);
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/command.mak com074c/command.mak
--- com074b/command.mak	Thu Jul 16 10:25:14 1998
+++ com074c/command.mak	Thu Jul 16 10:25:16 1998
@@ -37,7 +37,10 @@
  time.obj \
  exec.obj \
  lowexec.obj \
- type.obj
+ type.obj \
+ error.obj \
+ err_hand.obj \
+ misc.obj
 
 #		*Explicit Rules*
 command.exe: command.cfg $(EXE_dependencies)
@@ -60,7 +63,10 @@
 time.obj+
 exec.obj+
 lowexec.obj+
-type.obj
+type.obj+
+error.obj+
+err_hand.obj+
+misc.obj
 command
 		# no map file
 cs.lib
@@ -105,6 +111,12 @@
 	$(TASM) /MX /ZI /O LOWEXEC.ASM,LOWEXEC.OBJ
 
 type.obj: command.cfg type.c 
+
+error.obj: command.cfg error.c 
+
+err_hand.obj: command.cfg err_hand.c 
+
+misc.obj: command.cfg misc.c 
 
 #		*Compiler Configuration File*
 command.cfg: command.mak
Binary files com074b/command.prj and com074c/command.prj differ
Files com074b/date.c and com074c/date.c are identical
Files com074b/dir-test.txt and com074c/dir-test.txt are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/dir.c com074c/dir.c
--- com074b/dir.c	Thu Jul 16 11:29:11 1998
+++ com074c/dir.c	Thu Jul 16 11:29:11 1998
@@ -85,6 +85,9 @@
  * - fixed wide display so that an extra return is not displayed when
  *   there is five filenames in the last line.
  *
+ * 07/12/98 (Rob Lake)
+ * - Changed error messages
+ *
  */
 
 #include <stdio.h>
@@ -115,8 +118,8 @@
   DIR_WIDE = 4,                 /* Rob Lake */
   DIR_BARE = 8,                 /* Rob Lake */
   DIR_ALL = 16,                 /* Rob Lake */
-  DIR_LWR = 32
-};                              /* Rob Lake */
+  DIR_LWR = 32                  /* Rob Lake */
+};
 
 /* Globally save the # of dirs, files and bytes,
  * probabaly later pass them to functions. Rob Lake  */
@@ -190,7 +193,8 @@
           *flags &= ~DIR_LWR;
         else
         {
-          fprintf(stderr, INVALID_SWITCH, toupper(*line));
+          //fprintf(stderr, INVALID_SWITCH, toupper(*line));
+          invalid_switch(toupper(*line));
           return 1;
         }
         line++;
@@ -220,7 +224,8 @@
 /* Rob Lake */
         else
         {
-          fprintf(stderr, INVALID_SWITCH, toupper(*line));
+          //fprintf(stderr, INVALID_SWITCH, toupper(*line));
+          invalid_switch(toupper(*line));
           return 1;
         }
         line++;
@@ -233,7 +238,8 @@
     {
       if (*param)
       {
-        fprintf(stderr, TOO_MANY_PARAMETERS, *param);
+        //fprintf(stderr, TOO_MANY_PARAMETERS, *param);
+        too_many_parameters(*param);
         return 1;
       }
 
@@ -260,7 +266,8 @@
 
   if (slash)
   {
-    fprintf(stderr, INVALID_SWITCH, *line);
+    //fprintf(stderr, INVALID_SWITCH, *line);
+    invalid_switch(toupper(*line));
     return 1;
   }
 
@@ -427,7 +434,8 @@
   /* change to this directory and get its full name */
   if (chdir(start) < 0)
   {
-    fprintf(stderr, PATH_NOT_FOUND);
+    //fprintf(stderr, PATH_NOT_FOUND);
+    path_not_found();
     *tmp = '\\';
     free(*file);
     chdir(orig_dir);
@@ -530,7 +538,8 @@
   setdisk(drive);
   if (getdisk() != drive)
   {
-    fprintf(stderr, "Invalid drive specification\n");
+    //fprintf(stderr, "Invalid drive specification\n");
+    invalid_drive();
     return 1;
   }
 
@@ -676,7 +685,8 @@
      */
     if ((flags & DIR_RECURSE) == 0)
     {
-      printf("File not found.\n");
+      //fprintf(stderr, "File not found.\n");
+      file_not_found();
       incline(line, flags);
       return 1;
     }
Files com074b/environ.c and com074c/environ.c are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/err_hand.c com074c/err_hand.c
--- com074b/err_hand.c	Wed Dec 31 18:00:00 1969
+++ com074c/err_hand.c	Thu Jul 16 11:29:11 1998
@@ -0,0 +1,207 @@
+/*
+ * ERR_HAND.C -- Critical Error Handling, INT24 Function
+ *
+ * Comments:
+ *
+ * 07/03/98 (Rob Lake) ------------------------------------------------------
+ *      Started
+ *
+ */
+
+#include "err_hand.h"
+
+/* Code courtesy of Pasquale J. Villani */
+void
+init_error_handler(void)
+{
+  asm {
+    xor ax, ax
+    mov es, ax
+    mov si, 24h * 4
+    mov ax, offset dos_critical_error
+    mov es:[si], ax
+    mov ax, cs
+    mov es:[si + 2], ax
+  }
+}
+
+/*
+ *
+ * printstring -- uses DOS call (09h) to print a '$' terminated
+ * string
+ *
+ */
+static void
+printstring(char *string)
+{
+  asm {
+    push ds
+    push dx
+    push ax
+  }
+  _DS = FP_SEG(string);
+  _DX = FP_OFF(string);
+  asm {
+    mov ah, 09h
+    int 21h
+    pop ax
+    pop dx
+    pop ds
+  }
+}
+
+/*
+ *
+ * get_err -- returns the text to the actual error message
+ *
+ */
+static char *
+get_err(unsigned err_code)
+{
+  switch (err_code)
+  {
+    case WRITE_PROTECT_ERROR:
+      return "Write Protect Error";
+    case UNKNOWN_UNIT:
+      return "Unknown Unit";
+    case DRIVE_NOT_READY:
+      return "Drive Not Ready";
+    case UNKNOWN_COMMAND:
+      return "Unknown Command";
+    case CRC_ERROR:
+      return "CRC Error";
+    case BAD_LENGTH:
+      return "Bad Length";
+    case SEEK_ERROR:
+      return "Seek Error";
+    case UNKNOWN_MEDIA:
+      return "Unknown Media Type";
+    case SECTOR_NOT_FOUND:
+      return "Sector Not Found";
+    case OUT_OF_PAPER:
+      return "Out of Paper";
+    case WRITE_FAULT:
+      return "Write Fault";
+    case READ_FAULT:
+      return "Read Fault";
+    case GENERAL_FAILURE:
+    default:
+      return "General Failure";
+  }
+}
+
+/*
+ *
+ * dos_critical_error -- The actual handler
+ *
+ */
+#pragma argsused
+void interrupt far
+dos_critical_error(unsigned reg_Bp, unsigned reg_Di,
+         unsigned reg_Si, unsigned reg_Ds, unsigned reg_Es, unsigned reg_Dx,
+                   unsigned reg_Cx, unsigned reg_Bx, unsigned reg_Ax)
+{
+  unsigned err_flags,
+    drive,
+    err_code;
+  dev_hdr far *dev;
+  char *err_msg,
+    device[8],
+    buf[BUFSIZE],
+    action;
+
+  asm {
+    push cs
+    pop ds
+  }
+
+  err_flags = reg_Ax >> 8;      /* make it AH */
+  drive = reg_Ax & 0xFF;        /* make it AL */
+  err_code = reg_Di & 0xFF;     /* error code in lower byte of DI */
+  dev = (dev_hdr far *) MK_FP(reg_Bp, reg_Si);
+  err_msg = get_err(err_code);
+retry:
+  if (err_flags & CHAR_DEV)
+  {
+    int i;
+    for (i = 0; i < 8; i++)
+    {
+      if (dev->dev_name[i] == ' ')
+        break;
+      device[i] = dev->dev_name[i];
+    }
+    device[i] = '\0';
+    sprintf(buf, "\n\r\n%s error on %s\n\r$", err_msg, device);
+    printstring(buf);
+  }
+  else
+  {
+    sprintf(buf, "\n\r\n%s error on drive %c\n\r$", err_msg,
+            drive + 'A');
+    printstring(buf);
+  }
+
+/* Print appropriate message */
+  printstring("Abort$");
+  if (err_flags & RETRY_FLG)
+  {
+    if ((err_flags & (IGNORE_FLG | FAIL_FLG)) == 0)
+      printstring(", or $");
+    else
+      printstring(", $");
+    printstring("Retry$");
+  }
+  if (err_flags & FAIL_FLG)
+  {
+    if ((err_flags & IGNORE_FLG) == 0)
+      printstring(", or $");
+    else
+      printstring(", $");
+    printstring("Fail$");
+  }
+  if (err_flags & IGNORE_FLG)
+    printstring(", or Ignore$");
+  printstring("?$");
+
+/* Clear AL for return */
+  reg_Ax &= 0xFF00;
+
+  action = getche();
+  printstring("\n\r$");
+  switch (toupper(action))
+  {
+    case 'A':
+      reg_Ax |= ABORT;
+      return;
+    case 'R':
+      if ((err_flags & RETRY_FLG) == 0)
+      {
+        if ((err_flags & FAIL_FLG) == 0)
+          reg_Ax |= ABORT;
+        else
+          reg_Ax |= FAIL;
+      }
+      else
+        reg_Ax = RETRY;
+      return;
+    case 'F':
+      if ((err_flags & FAIL_FLG) == 0)
+        reg_Ax |= ABORT;
+      else
+        reg_Ax |= FAIL;
+      return;
+    case 'I':
+      if ((err_flags & IGNORE_FLG) == 0)
+      {
+        if ((err_flags & FAIL_FLG) == 0)
+          reg_Ax |= ABORT;
+        else
+          reg_Ax |= FAIL;
+      }
+      else
+        reg_Ax |= IGNORE;
+      return;
+    default:
+      goto retry;
+  }
+}
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/err_hand.h com074c/err_hand.h
--- com074b/err_hand.h	Wed Dec 31 18:00:00 1969
+++ com074c/err_hand.h	Thu Jul 16 11:29:11 1998
@@ -0,0 +1,53 @@
+/*
+ * ERR_HAND.H -- Header for Critical Error Handling
+ * Rob Lake
+ * 07/04/98
+ *
+ */
+
+#if !defined(__ERR_HAND_H)
+#define __ERR_HAND_H
+
+#include "command.h"
+#include <dos.h>
+#include <conio.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#define CHAR_DEV  128
+#define BUFSIZE   512
+#define FAIL_FLG        8
+#define RETRY_FLG       16
+#define IGNORE_FLG      32
+
+#define FAIL            3
+#define ABORT   2
+#define RETRY           1
+#define IGNORE    0
+
+#define WRITE_PROTECT_ERROR     0
+#define UNKNOWN_UNIT            1
+#define DRIVE_NOT_READY         2
+#define UNKNOWN_COMMAND         3
+#define CRC_ERROR               4
+#define BAD_LENGTH              5
+#define SEEK_ERROR              6
+#define UNKNOWN_MEDIA           7
+#define SECTOR_NOT_FOUND        8
+#define OUT_OF_PAPER            9
+#define WRITE_FAULT             10
+#define READ_FAULT              11
+#define GENERAL_FAILURE         12
+
+/* Device Driver Header */
+typedef struct _dev_hdr
+{
+  struct _dev_hdr *dev_next;    /* Ptr to next DDH   */
+  unsigned dev_attrib;          /* Device Attribute  */
+  void (*dev_strategy) ();      /* Strategy Routine  */
+  void (*dev_interrupt) ();     /* Interrupt Routine */
+  char dev_name[8];
+}
+dev_hdr;
+
+#endif /* __ERR_HAND_H */
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/error.c com074c/error.c
--- com074b/error.c	Wed Dec 31 18:00:00 1969
+++ com074c/error.c	Thu Jul 16 11:29:11 1998
@@ -0,0 +1,66 @@
+/*
+ * ERROR.C -- Error reporting functions
+ *
+ * 07/12/98 (Rob Lake) ------------------------------------------------------
+ *      started
+ *
+ */
+
+#include "command.h"
+#include <stdio.h>
+
+void
+invalid_switch(char c)
+{
+  fprintf(stderr, INVALID_SWITCH, c);
+}
+
+void
+too_many_parameters(char *s)
+{
+  fprintf(stderr, TOO_MANY_PARAMETERS, s);
+}
+
+void
+path_not_found(void)
+{
+  fprintf(stderr, PATH_NOT_FOUND);
+}
+
+void
+file_not_found(void)
+{
+  fprintf(stderr, FILE_NOT_FOUND);
+  //fprintf(stderr, "\n");
+}
+
+void
+sfile_not_found(char *f)
+{
+  file_not_found();
+  fprintf(stderr, " - %s\n", f);
+}
+
+void
+req_param_missing(void)
+{
+  fprintf(stderr, REQ_PARAM_MISSING);
+}
+
+void
+invalid_drive(void)
+{
+  fprintf(stderr, INVALID_DRIVE);
+}
+
+void
+badcommand(void)
+{
+  fprintf(stderr, BADCOMMAND);
+}
+
+void
+no_pipe(void)
+{
+  fprintf(stderr, CANNOTPIPE);
+}
Files com074b/exe2bin.com and com074c/exe2bin.com are identical
Files com074b/exec.c and com074c/exec.c are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/files.txt com074c/files.txt
--- com074b/files.txt	Thu Jul 16 11:29:11 1998
+++ com074c/files.txt	Thu Jul 16 11:29:11 1998
@@ -22,6 +22,9 @@
 date.c          Date command code
 dir.c           Directory listing code
 environ.c       Environment handling
+err_hand.c      Critical Error Handling code
+err_hand.h      Critical Error Handling header
+error.c         Error Message Routines
 exec.c          Exec C interface code
 history.c       Command-line history handling
 internal.c      Internal commands (DIR, RD, etc)
@@ -30,6 +33,7 @@
 loadhigh.h      Loadhigh header file
 lowexec.asm     Low-level exec functions
 model.def       memory model for exec stuff
+misc.c          Misc. Functions
 prompt.c        Prompt handling functions
 redir.c         Redirection and piping parsing functions
 tempfile.c      Re-implementation of tmpfile library function
Files com074b/history.c and com074c/history.c are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/history.txt com074c/history.txt
--- com074b/history.txt	Thu Jul 16 11:29:11 1998
+++ com074c/history.txt	Thu Jul 16 11:29:11 1998
@@ -185,3 +185,13 @@
 COMMAND.C
 o fixed call to spawnl so that it would pass command line arguments
   correctly.
+
+07/12/98 version 0.74c (Rob Lake rlake@cs.mun.ca)
+~~~~~~~~~~~~~~~~~~~~~~
+Various Files:
+o removed redundant use of error message defines and moved
+  error printing calls to ERROR.C to reduced program size.
+
+o created MISC.C
+o created ERR_HAND.C/H
+o created ERROR.C
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/internal.c com074c/internal.c
--- com074b/internal.c	Thu Jul 16 11:29:11 1998
+++ com074c/internal.c	Thu Jul 16 11:29:11 1998
@@ -125,7 +125,7 @@
 #include "command.h"
 
 #define SHELLINFO    "FreeDOS Command Line Interface"
-#define SHELLVER     "version 0.74b"
+#define SHELLVER     "version 0.74c"
 #define BADCMDLINE   "bad or incorrect command line"
 #define USAGE        "usage"
 #define CD           "change to directory   CD [d:][path]"
@@ -472,7 +472,8 @@
       /* is this a lone '/' ? */
       if (rest[i + 1] == 0)
       {
-        fprintf(stderr, INVALID_SWITCH, ' ');
+        //fprintf(stderr, INVALID_SWITCH, ' ');
+        invalid_switch(' ');
         return 1;
       }
       continue;
@@ -505,7 +506,8 @@
     }
     else
     {
-      fprintf(stderr, INVALID_SWITCH, toupper(rest[i]));
+      //fprintf(stderr, INVALID_SWITCH, toupper(rest[i]));
+      invalid_switch(toupper(rest[i]));
       return 1;
     }
   }
@@ -527,7 +529,8 @@
     flags,
     orig_disk,
     args,
-    inter;
+    inter,
+    filespec;
   struct ffblk f;
   static char drive[MAXDRIVE],
     dir[MAXDIR],
@@ -545,7 +548,8 @@
 
   if (args > 2)
   {
-    fprintf(stderr, TOO_MANY_PARAMETERS, arg[args - 1]);
+    //fprintf(stderr, TOO_MANY_PARAMETERS, arg[args - 1]);
+    too_many_parameters(arg[args - 1]);
     return 1;
   }
   else if (args >= 1)
@@ -561,27 +565,36 @@
     }
     /* check for /p as the first or second, MS-DOS
      * only allows for it as the second arg, so do we :) */
-    if (stricmp(arg[1], "/p") == 0 ||
-        stricmp(arg[0], "/p") == 0)
+    if (stricmp(arg[1], "/p") == 0)
+    {
+      inter = 1;
+      filespec = 0;
+    }
+    else if (stricmp(arg[0], "/p") == 0)
+    {
+      filespec = 1;
       inter = 1;
+    }
     /* only one argument and that's /P */
     if (args == 1 && inter)
     {
-      fprintf(stderr, REQ_PARAM_MISSING);
+      //fprintf(stderr, REQ_PARAM_MISSING);
+      req_param_missing();
       return 1;
     }
     /* check whether the file actually exists */
-    if (stat(arg[0], &stbuf) == -1)
+    if (stat(arg[filespec], &stbuf) == -1)
     {
-      fprintf(stderr, FILE_NOT_FOUND);
+      //fprintf(stderr, FILE_NOT_FOUND);
+      file_not_found();
       return 1;
     }
     /* check if it is a directory */
     if ((stbuf.st_mode & S_IFMT) == S_IFDIR
-        && strchr(arg[0], '*') == NULL)
-      strcat(arg[0], "\\");
+        && strchr(arg[filespec], '*') == NULL)
+      strcat(arg[filespec], "\\");
 
-    flags = fnsplit(arg[0], drive, dir, file, ext);
+    flags = fnsplit(arg[filespec], drive, dir, file, ext);
     /* build the filename, wildcards allowed */
     if (flags & FILENAME && flags && EXTENSION)
       sprintf(fn, "%s%s", file, ext);
@@ -609,7 +622,8 @@
       getcwd(orig_dir, MAXPATH);
       if (chdir(dir))
       {
-        fprintf(stderr, PATH_NOT_FOUND);
+        //fprintf(stderr, PATH_NOT_FOUND);
+        path_not_found();
         return 1;
       }
       if (dir[0] != '\0' && strlen(dir) > 1)
@@ -619,14 +633,16 @@
   else
   {
     /* only command given */
-    fprintf(stderr, REQ_PARAM_MISSING);
+    //fprintf(stderr, REQ_PARAM_MISSING);
+    req_param_missing();
     return 1;
   }
 
   /* needed? */
   if (inter && args == 1)
   {
-    fprintf(stderr, REQ_PARAM_MISSING);
+    //fprintf(stderr, REQ_PARAM_MISSING);
+    req_param_missing();
     return 1;
   }
 
@@ -638,8 +654,8 @@
     char c;
     c = 0;
     yes = 0;
-    printf("All files in directory will be deleted!\n");
-    printf("Are you sure (Y/N)?");
+    puts("All files in directory will be deleted!\n");
+    puts("Are you sure (Y/N)?");
     while (c != 13)
     {
       c = getch();
@@ -666,7 +682,8 @@
   if (done)
   {
     chdir(orig_dir);
-    fprintf(stderr, FILE_NOT_FOUND);
+    //fprintf(stderr, FILE_NOT_FOUND);
+    file_not_found();
     return 0;
   }
 
Files com074b/lh.asm and com074c/lh.asm are identical
Files com074b/license.txt and com074c/license.txt are identical
Files com074b/loadhigh.c and com074c/loadhigh.c are identical
Files com074b/loadhigh.h and com074c/loadhigh.h are identical
Files com074b/lowexec.asm and com074c/lowexec.asm are identical
Files com074b/makecom.bat and com074c/makecom.bat are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/misc.c com074c/misc.c
--- com074b/misc.c	Wed Dec 31 18:00:00 1969
+++ com074c/misc.c	Thu Jul 16 11:29:11 1998
@@ -0,0 +1,32 @@
+/*
+ * MISC.C -- Misc. Functions
+ *
+ * 07/12/98 (Rob Lake) -----------------------------------------------------
+ *  started
+ *
+ */
+
+#include <dos.h>
+
+/*
+ * exist -- Check to see if fn exists
+ *
+ */
+#include <io.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+/*
+ * exist -- Checks if a file exists
+ *
+ */
+int
+exist(char *fn)
+{
+  int f;
+  f = open(fn, O_BINARY);
+  if (f == -1)
+    return 0;
+  close(f);
+  return 1;
+}
Files com074b/model.def and com074c/model.def are identical
Files com074b/prompt.c and com074c/prompt.c are identical
Files com074b/readme.txt and com074c/readme.txt are identical
Files com074b/redir.c and com074c/redir.c are identical
Files com074b/tempfile.c and com074c/tempfile.c are identical
Files com074b/tempfile.h and com074c/tempfile.h are identical
Files com074b/test.bat and com074c/test.bat are identical
Files com074b/testenv.c and com074c/testenv.c are identical
Files com074b/time.c and com074c/time.c are identical
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/todo.txt com074c/todo.txt
--- com074b/todo.txt	Thu Jul 16 11:29:11 1998
+++ com074c/todo.txt	Thu Jul 16 11:29:11 1998
@@ -26,4 +26,4 @@
 Support '>>' redirection.  Currently this overwrites files instead of
 adding to them.
 
-Last Updated: 07/08/1998 by John P. Price
+Add INT23 Handler.
diff --new-file --recursive --ignore-space-change --unified --report-identical-files --minimal com074b/type.c com074c/type.c
--- com074b/type.c	Thu Jul 16 11:29:11 1998
+++ com074c/type.c	Thu Jul 16 11:29:11 1998
@@ -6,6 +6,8 @@
  *  07/08/1998 (John P. Price)
  *    started.
  *
+ * 07/12/98 (Rob Lake)
+ *   - Changed error messages
  *
  */
 
@@ -31,19 +33,22 @@
 
   if (!*rest)
   {
-    printf("Required parameter missing.\n");
+    //printf("Required parameter missing.\n");
+    req_param_missing();
     return 1;
   }
 
   if (strchr(rest, ' '))
   {
-    printf("Too many parameters.\n");
+    //printf("Too many parameters.\n");
+    too_many_parameters("\b \b");
     return 1;
   }
 
   if ((f = fopen(rest, "r")) == NULL)
   {
-    printf("File not found - %s\n", rest);
+    //printf("File not found - %s\n",rest);
+    sfile_not_found(rest);
     return 1;
   }
 
Files com074b/where.c and com074c/where.c are identical
