*** ram:Patch-2.1/pch.c	Tue Jun 01 06:54:18 1993
--- pch.c	Wed Aug 04 08:53:24 1993
***************
*** 211,213 ****
      Reg6 long first_command_line = -1;
!     long fcl_line;
      Reg7 bool last_line_was_command = FALSE;
--- 211,213 ----
      Reg6 long first_command_line = -1;
!     long fcl_line = 0;
      Reg7 bool last_line_was_command = FALSE;
***************
*** 426,428 ****
  static void
! malformed ()
  {
--- 426,428 ----
  static void
! malformed (void)
  {
***************
*** 1260,1262 ****
  	    Sprintf(buf, "/bin/ed - %s", TMPOUTNAME);
! 	pipefp = popen(buf, "w");
      }
--- 1260,1262 ----
              Sprintf(buf, "/bin/ed - %s", TMPOUTNAME);
!         pipefp = fopen(buf, "w");
      }
***************
*** 1295,1297 ****
      Fflush(pipefp);
!     Pclose(pipefp);
      ignore_signals();
--- 1295,1297 ----
      Fflush(pipefp);
!     fclose(pipefp);
      ignore_signals();
*** ram:Patch-2.1/patch.c	Sun May 30 21:46:14 1993
--- patch.c	Sun Aug 08 03:36:06 1993
***************
*** 1,4 ****
- char rcsid[] =
- 	"$Header: patch.c,v 2.0.2.0 90/05/01 22:17:50 davison Locked $";
- 
  /* patch - a program to apply diffs to original files
--- 1 ----
***************
*** 92,93 ****
--- 89,92 ----
  
+ #include <stdio.h>
+ 
  #include "INTERN.h"
***************
*** 104,119 ****
  
! void reinitialize_almost_everything();
! void get_some_switches();
! LINENUM locate_hunk();
! void abort_hunk();
! void apply_hunk();
! void init_output();
! void init_reject();
! void copy_till();
! void spew_output();
! void dump_line();
! bool patch_match();
! bool similar();
! void re_input();
! void my_exit();
  
--- 103,118 ----
  
! void reinitialize_almost_everything(void);
! void get_some_switches(void);
! LINENUM locate_hunk(LINENUM);
! void abort_hunk(void);
! void apply_hunk(LINENUM);
! void init_output(char *);
! void init_reject(char *);
! void copy_till(LINENUM);
! void spew_output(void);
! void dump_line(LINENUM);
! bool patch_match(LINENUM, LINENUM, LINENUM);
! bool similar(char *, char *, int);
! void re_input(void);
! void my_exit(int);
  
***************
*** 146,149 ****
  
-     myuid = getuid();
- 
      /* Cons up the names of the temporary files.  */
--- 145,146 ----
***************
*** 151,180 ****
        /* Directory for temporary files.  */
-       char *tmpdir;
-       int tmpname_len;
  
!       tmpdir = getenv ("TMPDIR");
!       if (tmpdir == NULL) {
! 	tmpdir = "/tmp";
!       }
!       tmpname_len = strlen (tmpdir) + 20;
! 
!       TMPOUTNAME = (char *) malloc (tmpname_len);
!       strcpy (TMPOUTNAME, tmpdir);
!       strcat (TMPOUTNAME, "/patchoXXXXXX");
!       Mktemp(TMPOUTNAME);
! 
!       TMPINNAME = (char *) malloc (tmpname_len);
!       strcpy (TMPINNAME, tmpdir);
!       strcat (TMPINNAME, "/patchiXXXXXX");
!       Mktemp(TMPINNAME);
! 
!       TMPREJNAME = (char *) malloc (tmpname_len);
!       strcpy (TMPREJNAME, tmpdir);
!       strcat (TMPREJNAME, "/patchrXXXXXX");
!       Mktemp(TMPREJNAME);
! 
!       TMPPATNAME = (char *) malloc (tmpname_len);
!       strcpy (TMPPATNAME, tmpdir);
!       strcat (TMPPATNAME, "/patchpXXXXXX");
!       Mktemp(TMPPATNAME);
      }
--- 148,154 ----
        /* Directory for temporary files.  */
  
!       TMPOUTNAME = tmpnam(malloc(L_tmpnam));
!       TMPINNAME  = tmpnam(malloc(L_tmpnam));
!       TMPREJNAME = tmpnam(malloc(L_tmpnam));
!       TMPPATNAME = tmpnam(malloc(L_tmpnam));
      }
***************
*** 200,201 ****
--- 174,177 ----
  
+     fprintf(stderr, "GNUPatch v2.1 - ported to the Amiga by Peter Simons <simons@peti.GUN.de>\n");
+ 
      /* make sure we clean up /tmp in case of disaster */
***************
*** 918,920 ****
  	    if (*a == '\n' || *b == '\n')
! 		return (*a == *b);	/* should end in sync */
  	}
--- 894,896 ----
              if (*a == '\n' || *b == '\n')
!                 return ((bool) (*a == *b)); /* should end in sync */
          }
***************
*** 935,944 ****
  {
!     Unlink(TMPINNAME);
!     if (!toutkeep) {
! 	Unlink(TMPOUTNAME);
!     }
!     if (!trejkeep) {
! 	Unlink(TMPREJNAME);
!     }
!     Unlink(TMPPATNAME);
      exit(status);
--- 911,917 ----
  {
!     unlink(TMPINNAME);          /* delete all temporary files */
!     unlink(TMPOUTNAME);
!     unlink(TMPREJNAME);
!     unlink(TMPPATNAME);
! 
      exit(status);
*** ram:Patch-2.1/getopt.c	Wed Jun 09 16:05:42 1993
--- getopt.c	Wed Aug 04 06:46:53 1993
***************
*** 39,41 ****
  #ifndef _AIX
! char *alloca ();
  #endif
--- 39,41 ----
  #ifndef _AIX
! char *alloca (unsigned);
  #endif
***************
*** 44,48 ****
  
! #if !__STDC__ && !defined(const) && IN_GCC
! #define const
! #endif
  
--- 44,49 ----
  
! /* #if !__STDC__ && !defined(const) && IN_GCC
!  * #define const
!  * #endif
!  */
  
***************
*** 54,55 ****
--- 55,58 ----
  #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
  
***************
*** 191,195 ****
  static char *
! my_index (str, chr)
!      const char *str;
!      int chr;
  {
--- 194,196 ----
  static char *
! my_index (const char *str, int chr)
  {
***************
*** 205,210 ****
  static void
! my_bcopy (from, to, size)
!      const char *from;
!      char *to;
!      int size;
  {
--- 206,208 ----
  static void
! my_bcopy (const char *from, char *to, int size)
  {
***************
*** 215,217 ****
  #endif				/* GNU C library.  */
! 
  /* Handle permutation of arguments.  */
--- 213,215 ----
  #endif                          /* GNU C library.  */
! 
  /* Handle permutation of arguments.  */
***************
*** 235,238 ****
  static void
! exchange (argv)
!      char **argv;
  {
--- 233,235 ----
  static void
! exchange (char **argv)
  {
***************
*** 647,652 ****
  int
! getopt (argc, argv, optstring)
!      int argc;
!      char *const *argv;
!      const char *optstring;
  {
--- 644,646 ----
  int
! getopt (int argc, char *const *argv, const char *optstring)
  {
*** ram:Patch-2.1/alloca.c	Tue May 25 05:43:36 1993
--- alloca.c	Tue Aug 17 11:49:54 1993
***************
*** 23,24 ****
--- 23,27 ----
  
+ #include <stdio.h>
+ #include <stdlib.h>
+ 
  #ifdef HAVE_CONFIG_H
***************
*** 60,63 ****
  
- #define	NULL	0
- 
  /* Different portions of Emacs need to call different versions of
--- 63,64 ----
***************
*** 74,76 ****
  #define malloc xmalloc
! extern pointer xmalloc ();
  #endif
--- 75,77 ----
  #define malloc xmalloc
! char *xmalloc(unsigned);
  #endif
***************
*** 77,78 ****
--- 78,80 ----
  
+ 
  /* Define STACK_DIRECTION if you know the direction of stack
***************
*** 99,101 ****
  static void
! find_stack_direction ()
  {
--- 101,103 ----
  static void
! find_stack_direction (void)
  {
***************
*** 152,156 ****
  
! pointer
! alloca (size)
!      unsigned size;
  {
--- 154,156 ----
  
! pointer alloca (unsigned size)
  {
*** ram:Patch-2.1/backupfile.c	Thu Jun 10 09:58:04 1993
--- backupfile.c	Wed Aug 04 06:23:56 1993
***************
*** 62,64 ****
     systems do not provide it. */
! #define REAL_DIR_ENTRY(dp) 1
  #else
--- 62,64 ----
     systems do not provide it. */
! #define real_DIR_ENTRY(dp) 1
  #else
***************
*** 74,82 ****
  
! char *basename ();
! char *dirname ();
! static char *concat ();
! char *find_backup_file_name ();
! static char *make_version_name ();
! static int max_backup_version ();
! static int version_number ();
  
--- 74,82 ----
  
! char *basename(char *);
! char *dirname(char *);
! static char *concat(char *, char *);
! char *find_backup_file_name(char *);
! static char *make_version_name (char *, int);
! static int max_backup_version (char *, char *);
! static int version_number (char *, char *, int);
  
***************
*** 85,88 ****
  char *
! basename (name)
!      char *name;
  {
--- 85,87 ----
  char *
! basename (char *name)
  {
***************
*** 103,106 ****
  char *
! find_backup_file_name (file)
!      char *file;
  {
--- 102,104 ----
  char *
! find_backup_file_name (char *file)
  {
***************
*** 140,143 ****
  static int
! max_backup_version (file, dir)
!      char *file, *dir;
  {
--- 138,140 ----
  static int
! max_backup_version (char *file, char *dir)
  {
***************
*** 145,149 ****
    struct dirent *dp;
!   int highest_version;
!   int this_version;
!   int file_name_length;
    
--- 142,144 ----
    struct dirent *dp;
!   int highest_version, this_version, file_name_length;
  
***************
*** 173,177 ****
  static char *
! make_version_name (file, version)
!      char *file;
!      int version;
  {
--- 168,170 ----
  static char *
! make_version_name (char *file, int version)
  {
***************
*** 191,196 ****
  static int
! version_number (base, backup, base_length)
!      char *base;
!      char *backup;
!      int base_length;
  {
--- 184,186 ----
  static int
! version_number (char *base, char *backup, int base_length)
  {
***************
*** 214,217 ****
  static char *
! concat (str1, str2)
!      char *str1, *str2;
  {
--- 204,206 ----
  static char *
! concat (char *str1, char *str2)
  {
***************
*** 234,237 ****
  char *
! dirname (path)
!      char *path;
  {
--- 223,225 ----
  char *
! dirname (char *path)
  {
***************
*** 270,274 ****
  int
! argmatch (arg, optlist)
!      char *arg;
!      char **optlist;
  {
--- 258,260 ----
  int
! argmatch (char *arg, char **optlist)
  {
***************
*** 309,314 ****
  void
! invalid_arg (kind, value, problem)
!      char *kind;
!      char *value;
!      int problem;
  {
--- 295,297 ----
  void
! invalid_arg (char *kind, char *value, int problem)
  {
***************
*** 381,383 ****
    if (slen_max == -1) {
! #if HAVE_LONG_FILE_NAMES
      slen_max = 255;
--- 364,366 ----
    if (slen_max == -1) {
! #ifdef HAVE_LONG_FILE_NAMES
      slen_max = 255;
*** ram:Patch-2.1/util.c	Tue Jun 01 01:34:50 1993
--- util.c	Tue Aug 17 11:47:06 1993
***************
*** 1 ****
--- 1,4 ----
+ #include <stdarg.h>
+ #include <proto/dos.h>
+ 
  #include "EXTERN.h"
***************
*** 6,8 ****
  
! void my_exit();
  
--- 9,11 ----
  
! void my_exit(int);
  
***************
*** 88,90 ****
  	}
! 	while (unlink(bakname) >= 0) ;	/* while() is for benefit of Eunice */
  #ifdef DEBUGGING
--- 91,94 ----
          }
!         unlink(bakname);
! 
  #ifdef DEBUGGING
***************
*** 98,100 ****
  	}
! 	while (unlink(to) >= 0) ;
      }
--- 102,104 ----
          }
!         unlink(to);
      }
***************
*** 192,198 ****
  void
! say(pat,arg1,arg2,arg3)
! char *pat;
! long arg1,arg2,arg3;
  {
!     fprintf(stderr, pat, arg1, arg2, arg3);
      Fflush(stderr);
--- 196,204 ----
  void
! say(char *fmt, ...)
  {
!     va_list args;
! 
!     va_start(args, fmt);
!     vfprintf(stderr, fmt, args);
!     va_end(args);
      Fflush(stderr);
***************
*** 203,210 ****
  void				/* very void */
! fatal(pat,arg1,arg2,arg3)
! char *pat;
! long arg1,arg2,arg3;
  {
      fprintf(stderr, "patch: **** ");
!     fprintf(stderr, pat, arg1, arg2, arg3);
      my_exit(1);
--- 209,218 ----
  void                            /* very void */
! fatal(char *fmt,...)
  {
+     va_list args;
+ 
      fprintf(stderr, "patch: **** ");
!     va_start(args, fmt);
!     vfprintf(stderr, fmt, args);
!     va_end(args);
      my_exit(1);
***************
*** 215,220 ****
  void				/* very void */
! pfatal(pat,arg1,arg2,arg3)
! char *pat;
! long arg1,arg2,arg3;
  {
      int errnum = errno;
--- 223,228 ----
  void                            /* very void */
! pfatal(char *fmt,...)
  {
+     va_list args;
+ 
      int errnum = errno;
***************
*** 222,224 ****
      fprintf(stderr, "patch: **** ");
!     fprintf(stderr, pat, arg1, arg2, arg3);
      fprintf(stderr, ": %s\n", strerror(errnum));
--- 230,234 ----
      fprintf(stderr, "patch: **** ");
!     va_start(args, fmt);
!     fprintf(stderr, fmt, args);
!     va_end(args);
      fprintf(stderr, ": %s\n", strerror(errnum));
***************
*** 230,271 ****
  void
! ask(pat,arg1,arg2,arg3)
! char *pat;
! long arg1,arg2,arg3;
! {
!     int ttyfd;
!     int r;
!     bool tty2 = isatty(2);
  
!     Sprintf(buf, pat, arg1, arg2, arg3);
!     Fflush(stderr);
!     write(2, buf, strlen(buf));
!     if (tty2) {				/* might be redirected to a file */
! 	r = read(2, buf, sizeof buf);
!     }
!     else if (isatty(1)) {		/* this may be new file output */
! 	Fflush(stdout);
! 	write(1, buf, strlen(buf));
! 	r = read(1, buf, sizeof buf);
!     }
!     else if ((ttyfd = open("/dev/tty", 2)) >= 0 && isatty(ttyfd)) {
! 					/* might be deleted or unwriteable */
! 	write(ttyfd, buf, strlen(buf));
! 	r = read(ttyfd, buf, sizeof buf);
! 	Close(ttyfd);
!     }
!     else if (isatty(0)) {		/* this is probably patch input */
! 	Fflush(stdin);
! 	write(0, buf, strlen(buf));
! 	r = read(0, buf, sizeof buf);
!     }
!     else {				/* no terminal at all--default it */
! 	buf[0] = '\n';
! 	r = 1;
      }
!     if (r <= 0)
! 	buf[0] = 0;
!     else
! 	buf[r] = '\0';
!     if (!tty2)
! 	say1(buf);
  }
--- 240,260 ----
  void
! ask(char *fmt, ...)
! {
!     va_list args;
!     int c;
  
!     va_start(args, fmt);
!     vfprintf(stderr, fmt, args);
!     fflush(stderr);
!     va_end(args);
! 
!     buf[0] = '\0';
!     if(IsInteractive(Input())) {
!         c = getchar();
!         if (c != EOF)
!                 buf[0] = c;
      }
! 
!     buf[1] = '\0';
!     fprintf(stderr, "\n");
  }
***************
*** 273,274 ****
--- 262,264 ----
  
+ 
  /* How to handle certain events when not in a critical region. */
***************
*** 280,282 ****
  #ifndef lint
!     static RETSIGTYPE (*hupval)(),(*intval)();
  
--- 270,273 ----
  #ifndef lint
!     static RETSIGTYPE (*intval)();
! /*    static RETSIGTYPE (*hupval)(); */
  
***************
*** 283,287 ****
      if (!reset) {
- 	hupval = signal(SIGHUP, SIG_IGN);
- 	if (hupval != SIG_IGN)
- 	    hupval = (RETSIGTYPE(*)())my_exit;
  	intval = signal(SIGINT, SIG_IGN);
--- 274,275 ----
***************
*** 290,292 ****
      }
-     Signal(SIGHUP, hupval);
      Signal(SIGINT, intval);
--- 278,279 ----
***************
*** 301,303 ****
  #ifndef lint
-     Signal(SIGHUP, SIG_IGN);
      Signal(SIGINT, SIG_IGN);
--- 288,289 ----
***************
*** 377,380 ****
  #endif
!     if (strnEQ(at, "/dev/null", 9))	/* so files can be created by diffing */
! 	return Nullch;			/*   against /dev/null. */
      name = fullname = t = savestr(at);
--- 363,365 ----
  #endif
! 
      name = fullname = t = savestr(at);
***************
*** 410,418 ****
  
! #define try(f, a1, a2) (Sprintf(tmpbuf + pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0)
! 	if (   try("RCS/%s%s", filebase, RCSSUFFIX)
! 	    || try("RCS/%s"  , filebase,         0)
! 	    || try(    "%s%s", filebase, RCSSUFFIX)
! 	    || try("SCCS/%s%s", SCCSPREFIX, filebase)
! 	    || try(     "%s%s", SCCSPREFIX, filebase))
! 	  return name;
  	free(name);
--- 395,400 ----
  
! /**
!  **     No RCS-support! See pin.c for further details!
!  **/
! 
          free(name);
***************
*** 425,428 ****
  char *
! xmalloc (size)
!      unsigned size;
  {
--- 407,409 ----
  char *
! xmalloc (unsigned size)
  {
*** ram:Patch-2.1/inp.c	Tue Jun 08 20:23:00 1993
--- inp.c	Fri Aug 13 17:10:26 1993
***************
*** 33,35 ****
  void
! re_input()
  {
--- 33,35 ----
  void
! re_input(void)
  {
***************
*** 61,64 ****
  void
! scan_input(filename)
! char *filename;
  {
--- 61,63 ----
  void
! scan_input(char *filename)
  {
***************
*** 75,78 ****
  bool
! plan_a(filename)
! char *filename;
  {
--- 74,76 ----
  bool
! plan_a(char *filename)
  {
***************
*** 81,84 ****
      Reg2 LINENUM iline;
!     char lbuf[MAXLINELEN];
!     int output_elsewhere = strcmp(filename, outname);
  
--- 79,82 ----
      Reg2 LINENUM iline;
! /*    char lbuf[MAXLINELEN]; */
! /*    int output_elsewhere = strcmp(filename, outname); */
  
***************
*** 92,157 ****
      }
!     /* For nonexistent or read-only files, look for RCS or SCCS versions.  */
!     if (statfailed
! 	|| (! output_elsewhere
! 	    && (/* No one can write to it.  */
! 		(filestat.st_mode & 0222) == 0
! 		/* I can't write to it.  */
! 		|| ((filestat.st_mode & 0022) == 0
! 		    && filestat.st_uid != myuid)))) {
! 	struct stat cstat;
! 	char *cs = Nullch;
! 	char *filebase;
! 	int pathlen;
! 
! 	filebase = basename(filename);
! 	pathlen = filebase - filename;
! 
! 	/* Put any leading path into `s'.
! 	   Leave room in lbuf for the diff command.  */
! 	s = lbuf + 20;
! 	strncpy(s, filename, pathlen);
! 
! #define try(f,a1,a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0)
! 	if ((   try("RCS/%s%s", filebase, RCSSUFFIX)
! 	     || try("RCS/%s"  , filebase,         0)
! 	     || try(    "%s%s", filebase, RCSSUFFIX))
! 	    &&
! 	    /* Check that RCS file is not working file.
! 	       Some hosts don't report file name length errors.  */
! 	    (statfailed
! 	     || (  (filestat.st_dev ^ cstat.st_dev)
! 		 | (filestat.st_ino ^ cstat.st_ino)))) {
! 	    Sprintf(buf, output_elsewhere?CHECKOUT:CHECKOUT_LOCKED, filename);
! 	    Sprintf(lbuf, RCSDIFF, filename);
! 	    cs = "RCS";
! 	} else if (   try("SCCS/%s%s", SCCSPREFIX, filebase)
! 		   || try(     "%s%s", SCCSPREFIX, filebase)) {
! 	    Sprintf(buf, output_elsewhere?GET:GET_LOCKED, s);
! 	    Sprintf(lbuf, SCCSDIFF, s, filename);
! 	    cs = "SCCS";
! 	} else if (statfailed)
! 	    fatal2("can't find %s\n", filename);
! 	/* else we can't write to it but it's not under a version
! 	   control system, so just proceed.  */
! 	if (cs) {
! 	    if (!statfailed) {
! 		if ((filestat.st_mode & 0222) != 0)
! 		    /* The owner can write to it.  */
! 		    fatal3("file %s seems to be locked by somebody else under %s\n",
! 			   filename, cs);
! 		/* It might be checked out unlocked.  See if it's safe to
! 		   check out the default version locked.  */
! 		if (verbose)
! 		    say3("Comparing file %s to default %s version...\n",
! 			 filename, cs);
! 		if (system(lbuf))
! 		    fatal3("can't check out file %s: differs from default %s version\n",
! 			   filename, cs);
! 	    }
! 	    if (verbose)
! 		say3("Checking out file %s from %s...\n", filename, cs);
! 	    if (system(buf) || stat(filename, &filestat))
! 		fatal3("can't check out file %s from %s\n", filename, cs);
! 	}
!     }
      filemode = filestat.st_mode;
--- 90,98 ----
      }
! 
! /**
!  **     I'm sorry to disable this nice piece of code, but RCS or  SCCS
!  **     are quiete uncommon on the Amiga, at least  Patch  isn't  used
!  **     with them. So, is would just confuse the user.       -psimoms
!  **/
! 
      filemode = filestat.st_mode;
***************
*** 246,249 ****
  void
! plan_b(filename)
! char *filename;
  {
--- 187,189 ----
  void
! plan_b(char *filename)
  {
***************
*** 319,323 ****
  char *
! ifetch(line,whichbuf)
! Reg1 LINENUM line;
! int whichbuf;				/* ignored when file in memory */
  {
--- 259,261 ----
  char *
! ifetch(LINENUM line, int whichbuf)
  {
***************
*** 350,353 ****
  bool
! rev_in_string(string)
! char *string;
  {
--- 288,290 ----
  bool
! rev_in_string(char *string)
  {
*** ram:Patch-2.1/getopt1.c	Sat May 08 00:29:54 1993
--- getopt1.c	Wed Aug 04 06:50:23 1993
***************
*** 24,28 ****
  
! #if !__STDC__ && !defined(const) && IN_GCC
! #define const
! #endif
  
--- 24,29 ----
  
! /* #if !__STDC__ && !defined(const) && IN_GCC
!  * #define const
!  * #endif
!  */
  
*** ram:Patch-2.1/version.c	Fri Jun 11 09:25:56 1993
--- version.c	Wed Aug 04 09:30:08 1993
***************
*** 15,17 ****
  
! void my_exit();
  
--- 15,17 ----
  
! void my_exit(int);
  
***************
*** 20,22 ****
  void
! version()
  {
--- 20,22 ----
  void
! version(void)
  {
*** ram:Patch-2.1/util.h	Mon Jul 20 23:27:08 1992
--- util.h	Wed Aug 04 07:53:00 1993
***************
*** 76,88 ****
  
! char *fetchname();
! int move_file();
! void copy_file();
! void say();
! void fatal();
! void pfatal();
! void ask();
! char *savestr();
! void set_signals();
! void ignore_signals();
! void makedirs();
! char *basename();
--- 76,88 ----
  
! char *fetchname(char *, int, int);
! int move_file(char *, char *);
! void copy_file(char *, char *);
! void say(char *, ...);
! void fatal(char *, ...);
! void pfatal(char *, ...);
! void ask(char *, ...);
! char *savestr(char *);
! void set_signals(int);
! void ignore_signals(void);
! void makedirs(char *, bool);
! char *basename(char *);
*** ram:Patch-2.1/config.h	Tue Jun 01 00:53:10 1993
--- config.h	Tue Aug 17 11:25:57 1993
***************
*** 6,8 ****
  /* Define if the system supports file names longer than 14 characters.  */
! #undef HAVE_LONG_FILE_NAMES
  
--- 6,8 ----
  /* Define if the system supports file names longer than 14 characters.  */
! #define HAVE_LONG_FILE_NAMES
  
***************
*** 12,14 ****
  /* Define if the system has strerror().  */
! #undef HAVE_STRERROR
  
--- 12,14 ----
  /* Define if the system has strerror().  */
! #define HAVE_STRERROR
  
***************
*** 15,17 ****
  /* Define if the system has ANSI C header files and library functions.  */
! #undef STDC_HEADERS
  
--- 15,17 ----
  /* Define if the system has ANSI C header files and library functions.  */
! #define STDC_HEADERS
  
***************
*** 21,27 ****
  
- #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
- #define index strchr
- #define rindex strrchr
- #endif
- 
  /* Define if the system has unistd.h.  */
--- 21,22 ----
***************
*** 30,32 ****
  /* Define if the system has fcntl.h.  */
! #undef HAVE_FCNTL_H
  
--- 25,27 ----
  /* Define if the system has fcntl.h.  */
! #define HAVE_FCNTL_H
  
***************
*** 40,42 ****
  /*  Which directory library header to use.  */
! #undef DIRENT			/* dirent.h */
  #undef SYSNDIR			/* sys/ndir.h */
--- 35,37 ----
  /*  Which directory library header to use.  */
! #define DIRENT                   /* dirent.h */
  #undef SYSNDIR                  /* sys/ndir.h */
***************
*** 51,53 ****
     multi-line arguments to macros.  */
! #undef CANVARARG
  
--- 46,48 ----
     multi-line arguments to macros.  */
! #define CANVARARG
  
***************
*** 64,71 ****
  
! #define Reg1 register
! #define Reg2 register
! #define Reg3 register
! #define Reg4 register
! #define Reg5 register
! #define Reg6 register
  #define Reg7
--- 59,66 ----
  
! #define Reg1
! #define Reg2
! #define Reg3
! #define Reg4
! #define Reg5
! #define Reg6
  #define Reg7
*** ram:Patch-2.1/pch.h	Wed Aug 15 10:13:38 1990
--- pch.h	Wed Aug 04 07:49:00 1993
***************
*** 13,36 ****
  
! void re_patch();
! void open_patch_file();
! void set_hunkmax();
! void grow_hunkmax();
! bool there_is_another_patch();
! int intuit_diff_type();
! void next_intuit_at();
! void skip_to();
! bool another_hunk();
! bool pch_swap();
! char *pfetch();
! short pch_line_len();
! LINENUM pch_first();
! LINENUM pch_ptrn_lines();
! LINENUM pch_newfirst();
! LINENUM pch_repl_lines();
! LINENUM pch_end();
! LINENUM pch_context();
! LINENUM pch_hunk_beg();
! char pch_char();
! char *pfetch();
! char *pgets();
! void do_ed_script();
--- 13,36 ----
  
! void re_patch(void);
! void open_patch_file(char *);
! void set_hunkmax(void);
! void grow_hunkmax(void);
! bool there_is_another_patch(void);
! int intuit_diff_type(void);
! void next_intuit_at(long, long);
! void skip_to(long, long);
! bool another_hunk(void);
! bool pch_swap(void);
! char *pfetch(LINENUM);
! short pch_line_len(LINENUM);
! LINENUM pch_first(void);
! LINENUM pch_ptrn_lines(void);
! LINENUM pch_newfirst(void);
! LINENUM pch_repl_lines(void);
! LINENUM pch_end(void);
! LINENUM pch_context(void);
! LINENUM pch_hunk_beg(void);
! char pch_char(LINENUM);
! char *pfetch(LINENUM);
! char *pgets(char *, int, FILE *);
! void do_ed_script(void);
*** ram:Patch-2.1/inp.h	Wed Aug 15 10:13:38 1990
--- inp.h	Wed Aug 04 07:35:08 1993
***************
*** 12,18 ****
  
! bool rev_in_string();
! void scan_input();
! bool plan_a();			/* returns false if insufficient memory */
! void plan_b();
! char *ifetch();
  
--- 12,18 ----
  
! bool rev_in_string(char *);
! void scan_input(char *);
! bool plan_a(char *);                  /* returns false if insufficient memory */
! void plan_b(char *);
! char *ifetch(LINENUM, int);
  
*** ram:Patch-2.1/version.h	Wed Aug 15 10:13:40 1990
--- version.h	Wed Aug 04 09:30:14 1993
***************
*** 8,9 ****
  
! void version();
--- 8,9 ----
  
! void version(void);
