*** f:/perl5.001.m/doio.c	Mon Jul 03 00:05:30 1995
--- perl5/doio.c	Sun Jul 02 23:41:26 1995
***************
*** 36,41 ****
--- 36,44 ----
  #ifdef I_UTIME
  #include <utime.h>
  #endif
+ #ifdef I_SYS_UTIME
+ #include <sys/utime.h>
+ #endif
  #ifdef I_FCNTL
  #include <fcntl.h>
  #endif
*** f:/perl5.001.m/ext/DynaLoader/DynaLoader.pm	Mon Jul 03 00:05:30 1995
--- perl5/ext/DynaLoader/DynaLoader.pm	Mon Jul 03 00:14:04 1995
***************
*** 407,412 ****
--- 407,413 ----
  
      my(@modparts) = split(/::/,$module);
      my($modfname) = $modparts[-1];
+     $modfname .= '_' if $Config{'osname'} eq "OS/2";
      my($modpname) = join('/',@modparts);
      foreach (@INC) {
  	my $dir = "$_/auto/$modpname";
*** f:/perl5.001.m/ext/POSIX/POSIX.xs	Mon Jul 03 00:03:42 1995
--- perl5/ext/POSIX/POSIX.xs	Sun Jul 02 23:40:26 1995
***************
*** 174,179 ****
--- 174,183 ----
  #define localeconv() not_here("localeconv")
  #endif
  
+ #ifndef HAS_MKFIFO
+ #define mkfifo(a,b) not_here("mkfifo")
+ #endif
+ 
  #ifdef HAS_TZNAME
  extern char *tzname[];
  #else
*** f:/perl5.001.m/lib/Cwd.pm	Mon Jul 03 00:03:12 1995
--- perl5/lib/Cwd.pm	Sun Jul 02 23:40:02 1995
***************
*** 53,58 ****
--- 53,59 ----
  sub getcwd
  {
      if($Config{'osname'} eq 'VMS') { return $ENV{'PWD'} = $ENV{'DEFAULT'} }
+     if($Config{'osname'} eq 'OS/2') { $_ = `\@cd`; s'\\'/'g; s/\s+$//g; return $_; }
  
      my($dotdots, $cwd, @pst, @cst, $dir, @tst);
  
***************
*** 121,126 ****
--- 122,128 ----
  
  sub fastcwd {
      if($Config{'osname'} eq 'VMS') { return $ENV{'DEFAULT'} }
+     if($Config{'osname'} eq 'OS/2') { $_ = `\@cd`; s'\\'/'g; s/\s+$//g; return $_; }
  
      my($odev, $oino, $cdev, $cino, $tdev, $tino);
      my(@path, $path);
***************
*** 134,145 ****
  	($cdev, $cino) = stat('.');
  	last if $odev == $cdev && $oino == $cino;
  	opendir(DIR, '.');
! 	for (;;) {
! 	    $direntry = readdir(DIR);
  	    next if $direntry eq '.';
  	    next if $direntry eq '..';
- 
- 	    last unless defined $direntry;
  	    ($tdev, $tino) = lstat($direntry);
  	    last unless $tdev != $odev || $tino != $oino;
  	}
--- 136,144 ----
  	($cdev, $cino) = stat('.');
  	last if $odev == $cdev && $oino == $cino;
  	opendir(DIR, '.');
! 	while ($direntry = readdir(DIR)) {
  	    next if $direntry eq '.';
  	    next if $direntry eq '..';
  	    ($tdev, $tino) = lstat($direntry);
  	    last unless $tdev != $odev || $tino != $oino;
  	}
*** f:/perl5.001.m/lib/ExtUtils/MakeMaker.pm	Mon Jul 03 00:07:38 1995
--- perl5/lib/ExtUtils/MakeMaker.pm	Sun Jul 02 23:45:30 1995
***************
*** 729,743 ****
  
      # --- Initialize Perl Binary Locations
  
      # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
      # will be working versions of perl 5. miniperl has priority over perl
      # for PERL to ensure that $(PERL) is usable while building ./ext/*
!     $att{'PERL'} =
!       MY->find_perl(5.0, ['miniperl','perl','perl5',"perl$]" ],
! 		    [ grep defined $_, $att{PERL_SRC}, split(":", $ENV{PATH}),
! 		     $Config{'bin'} ], $Verbose )
! 	unless ($att{'PERL'});	# don't check, if perl is executable, maybe they
! 				# they have decided to supply switches with perl
  
      # Define 'FULLPERL' to be a non-miniperl (used in test: target)
      ($att{'FULLPERL'} = $att{'PERL'}) =~ s/miniperl/perl/
--- 729,743 ----
  
      # --- Initialize Perl Binary Locations
  
+     # AK: Hardcoding ":" is a bad idea but Unix people will never learn this.
+     my $pathsep = exists($Config{'pathsep'}) ? $Config{'pathsep'} : ":";
+ 
      # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
      # will be working versions of perl 5. miniperl has priority over perl
      # for PERL to ensure that $(PERL) is usable while building ./ext/*
!     $att{'PERL'} = MY->find_perl(5.0, [ qw(miniperl perl) ],
! 	    [ grep defined $_, $att{PERL_SRC}, split($pathsep, $ENV{PATH}), $Config{'bin'} ], $Verbose )
! 	unless ($att{'PERL'} && -x $att{'PERL'});
  
      # Define 'FULLPERL' to be a non-miniperl (used in test: target)
      ($att{'FULLPERL'} = $att{'PERL'}) =~ s/miniperl/perl/
***************
*** 927,933 ****
  sub find_perl{
      my($self, $ver, $names, $dirs, $trace) = @_;
      my($name, $dir);
!     if ($trace >= 2){
  	print "Looking for perl $ver by these names: ";
  	print "@$names, ";
  	print "in these dirs:";
--- 927,934 ----
  sub find_perl{
      my($self, $ver, $names, $dirs, $trace) = @_;
      my($name, $dir);
!     my $ext = exists($Config{'exeext'}) ? $Config{'exeext'} : "";
!     if ($trace){
  	print "Looking for perl $ver by these names: ";
  	print "@$names, ";
  	print "in these dirs:";
***************
*** 936,953 ****
      foreach $dir (@$dirs){
  	next unless defined $dir; # $att{PERL_SRC} may be undefined
  	foreach $name (@$names){
  	    print "Checking $dir/$name " if ($trace >= 2);
- 	    if ($Is_VMS) {
- 	      $name .= ".exe" unless -x "$dir/$name";
- 	    }
  	    next unless -x "$dir/$name";
  	    print "Executing $dir/$name" if ($trace >= 2);
  	    my($out);
  	    if ($Is_VMS) {
  	      my($vmscmd) = 'MCR ' . vmsify("$dir/$name");
  	      $out = `$vmscmd -e "require $ver; print ""VER_OK\n"""`;
  	    } else {
! 	      $out = `$dir/$name -e 'require $ver; print "VER_OK\n" ' 2>&1`;
  	    }
  	    if ($out =~ /VER_OK/) {
  		print "Using PERL=$dir/$name" if $trace;
--- 937,956 ----
      foreach $dir (@$dirs){
  	next unless defined $dir; # $att{PERL_SRC} may be undefined
  	foreach $name (@$names){
+             $name .= $ext unless $name =~ /$ext$/oi;
  	    print "Checking $dir/$name " if ($trace >= 2);
  	    next unless -x "$dir/$name";
  	    print "Executing $dir/$name" if ($trace >= 2);
  	    my($out);
  	    if ($Is_VMS) {
  	      my($vmscmd) = 'MCR ' . vmsify("$dir/$name");
  	      $out = `$vmscmd -e "require $ver; print ""VER_OK\n"""`;
+ 	    } elsif ($Config{'osname'} eq "OS/2") {
+                 $_ = "$dir/$name";
+ 		s'/'\\'g;
+ 	        $out = `$_ -e "require $ver; print 'VER_OK' " 2>&1`;
  	    } else {
! 	        $out = `$dir/$name -e 'require $ver; print "VER_OK\n" ' 2>&1`;
  	    }
  	    if ($out =~ /VER_OK/) {
  		print "Using PERL=$dir/$name" if $trace;
*** f:/perl5.001.m/lib/perl5db.pl	Mon Mar 13 04:34:52 1995
--- perl5/lib/perl5db.pl	Thu Mar 16 16:24:00 1995
***************
*** 17,28 ****
  
  local($^W) = 0;
  
! if (-e "/dev/tty") {
      $console = "/dev/tty";
      $rcfile=".perldb";
  }
! elsif (-e "con") {
!     $console = "con";
      $rcfile="perldb.ini";
  }
  else {
--- 17,28 ----
  
  local($^W) = 0;
  
! if (-c "/dev/tty") {
      $console = "/dev/tty";
      $rcfile=".perldb";
  }
! elsif (-c "/dev/con") {
!     $console = "/dev/con";
      $rcfile="perldb.ini";
  }
  else {
*** f:/perl5.001.m/lib/Shell.pm	Tue Oct 18 17:34:58 1994
--- perl5/lib/Shell.pm	Mon May 22 19:12:02 1995
***************
*** 1,5 ****
--- 1,7 ----
  package Shell;
  
+ use Config;
+ 
  sub import {
      my $self = shift;
      my ($callpack, $callfile, $callline) = caller;
***************
*** 18,45 ****
  AUTOLOAD {
      my $cmd = $AUTOLOAD;
      $cmd =~ s/^.*:://;
!     eval qq {
  	sub $AUTOLOAD {
! 	    if (\@_ < 2) {
! 		`$cmd \@_`;
  	    }
! 	    else {
! 		open(SUBPROC, "-|")
! 			or exec '$cmd', \@_
! 			or die "Can't exec $cmd: \$!\n";
! 		if (wantarray) {
! 		    my \@ret = <SUBPROC>;
! 		    close SUBPROC;	# XXX Oughta use a destructor.
! 		    \@ret;
! 		}
! 		else {
! 		    local(\$/) = undef;
! 		    my \$ret = <SUBPROC>;
! 		    close SUBPROC;
! 		    \$ret;
! 		}
  	    }
  	}
      };
      goto &$AUTOLOAD;
  }
--- 20,83 ----
  AUTOLOAD {
      my $cmd = $AUTOLOAD;
      $cmd =~ s/^.*:://;
!     if ($Config{'archname'} eq 'os2') {
!       eval qq {
  	sub $AUTOLOAD {
! 	  if (\@_ < 1) {
! 	    `$cmd`;
! 	  } else {
! 	    local(\*SAVEOUT, \*READ, \*WRITE);
! 
! 	    open SAVEOUT, '>&STDOUT' or die;
! 	    pipe READ, WRITE or die;
! 	    close STDOUT;
! 	    open STDOUT, '>&WRITE' or die;
! 	    close WRITE;
! 
! 	    my \$pid = system(1, $cmd, \@_);
! 	    die "Can't execute $cmd: \$!\n" if \$pid < 0;
! 
! 	    close STDOUT;
! 	    open STDOUT, '>&SAVEOUT' or die;
! 	    close SAVEOUT;
! 
! 	    if (wantarray) {
! 	      my \@ret = <READ>;
! 	      close READ;
! 	      waitpid \$pid, 0;
! 	      \@ret;
! 	    } else {
! 	      local(\$/) = undef;
! 	      my \$ret = <READ>;
! 	      close READ;
! 	      waitpid \$pid, 0;
! 	      \$ret;
  	    }
! 	  }
! 	}
!       }
!     } else {
!       eval qq {
! 	sub $AUTOLOAD {
! 	  if (\@_ < 1) {
! 	    `$cmd`;
! 	  } else {
! 	    open(SUBPROC, "-|")
! 	      or exec '$cmd', \@_
! 	      or die "Can't exec $cmd: \$!\n";
! 	    if (wantarray) {
! 	      my \@ret = <SUBPROC>;
! 	      close SUBPROC;	# XXX Oughta use a destructor.
! 		\@ret;
! 	    } else {
! 	      local(\$/) = undef;
! 	      my \$ret = <SUBPROC>;
! 	      close SUBPROC;
! 	      \$ret;
  	    }
+ 	  }
  	}
+       }
      };
      goto &$AUTOLOAD;
  }
*** f:/perl5.001.m/mg.c	Tue Mar 07 02:46:38 1995
--- perl5/mg.c	Tue May 09 11:14:56 1995
***************
*** 1250,1256 ****
      CV *cv;
      AV *oldstack;
  
! #ifdef OS2		/* or anybody else who requires SIG_ACK */
      signal(sig, SIG_ACK);
  #endif
  
--- 1250,1256 ----
      CV *cv;
      AV *oldstack;
  
! #ifdef __EMX__		/* or anybody else who requires SIG_ACK */
      signal(sig, SIG_ACK);
  #endif
  
*** f:/perl5.001.m/miniperlmain.c	Tue Feb 14 03:48:50 1995
--- perl5/miniperlmain.c	Tue May 09 12:02:32 1995
***************
*** 16,21 ****
--- 16,31 ----
  {
      int exitstatus;
  
+ #ifdef OS2
+ # ifdef __IBMC__
+     response_expand(&argc, &argv);
+     expand_argv(&argc, &argv);
+ # else
+     _response(&argc, &argv);
+     _wildcard(&argc, &argv);
+ # endif
+ #endif
+ 
  #ifdef VMS
      getredirection(&argc,&argv);
  #endif
*** f:/perl5.001.m/perl.c	Mon Jul 03 00:07:42 1995
--- perl5/perl.c	Sun Jul 02 23:45:32 1995
***************
*** 1001,1010 ****
  #ifdef MSDOS
  	fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
  	stdout);
- #ifdef OS2
-         fputs("OS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n",
-         stdout);
  #endif
  #endif
  #ifdef atarist
          fputs("atariST series port, ++jrb  bammi@cadence.com\n", stdout);
--- 1001,1011 ----
  #ifdef MSDOS
  	fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
  	stdout);
  #endif
+ #ifdef OS2
+         fputs("OS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n"
+         	"Version 5 port Copyright (c) 1994-1995, Andreas Kaiser\n",
+ 		stdout);
  #endif
  #ifdef atarist
          fputs("atariST series port, ++jrb  bammi@cadence.com\n", stdout);
*** f:/perl5.001.m/perl.h	Mon Jul 03 00:07:42 1995
--- perl5/perl.h	Sun Jul 02 23:45:34 1995
***************
*** 32,48 ****
   * code can be a lot prettier.  Well, so much for theory.  Sorry, Henry...
   */
  
- #ifdef MYMALLOC
- #   ifdef HIDEMYMALLOC
- #	define malloc Mymalloc
- #	define realloc Myremalloc
- #	define free Myfree
- #   endif
- #   define safemalloc malloc
- #   define saferealloc realloc
- #   define safefree free
- #endif
- 
  /* work around some libPW problems */
  #ifdef DOINIT
  EXT char Error[1];
--- 32,37 ----
***************
*** 110,115 ****
--- 99,115 ----
  #   include <stdlib.h>
  #endif /* STANDARD_C */
  
+ #ifdef MYMALLOC
+ #   ifdef HIDEMYMALLOC
+ #	define malloc Mymalloc
+ #	define realloc Myremalloc
+ #	define free Myfree
+ #   endif
+ #   define safemalloc malloc
+ #   define saferealloc realloc
+ #   define safefree free
+ #endif
+ 
  #define MEM_SIZE Size_t
  
  #if defined(I_STRING) || defined(__cplusplus)
***************
*** 537,543 ****
--- 537,547 ----
  #define FILTER_ISREADER(idx)	   (idx >= AvFILL(rsfp_filters))
  
  #ifdef DOSISH
+ # if defined(OS2)
+ #   include "os2ish.h"
+ # else
  #   include "dosish.h"
+ # endif
  #else
  # if defined(VMS)
  #   include "vmsish.h"
*** f:/perl5.001.m/pp.c	Mon Jul 03 00:00:14 1995
--- perl5/pp.c	Mon Jul 03 00:34:14 1995
***************
*** 3391,3397 ****
      else {
  	maxiters += (strend - s) * rx->nparens;
  	while (s < strend && --limit &&
! 	    regexec(rx, s, strend, orig, 1, Nullsv, TRUE) ) {
  	    if (rx->subbase
  	      && rx->subbase != orig) {
  		m = s;
--- 3391,3397 ----
      else {
  	maxiters += (strend - s) * rx->nparens;
  	while (s < strend && --limit &&
! 	    pregexec(rx, s, strend, orig, 1, Nullsv, TRUE) ) {
  	    if (rx->subbase
  	      && rx->subbase != orig) {
  		m = s;
*** f:/perl5.001.m/pp_ctl.c	Mon Jul 03 00:07:44 1995
--- perl5/pp_ctl.c	Sun Jul 02 23:45:34 1995
***************
*** 2002,2013 ****
  	(*tmpname == '.' && 
  	    (tmpname[1] == '/' ||
  	     (tmpname[1] == '.' && tmpname[2] == '/')))
  #ifdef VMS
! 	|| ((*tmpname == '[' || *tmpname == '<') &&
! 	    (tmpname[1] == '-' || tmpname[1] == ']' || tmpname[1] == '>'))
  #endif
!     )
!     {
  	tryrsfp = fopen(tmpname,"r");
      }
      else {
--- 2002,2015 ----
  	(*tmpname == '.' && 
  	    (tmpname[1] == '/' ||
  	     (tmpname[1] == '.' && tmpname[2] == '/')))
+ #ifdef DOSISH
+       || tmpname[0] && tmpname[1] == ':'
+ #endif
  #ifdef VMS
!       || ((*tmpname == '[' || *tmpname == '<')
!        && (tmpname[1] == '-' || tmpname[1] == ']' || tmpname[1] == '>'))
  #endif
!     ){
  	tryrsfp = fopen(tmpname,"r");
      }
      else {
*** f:/perl5.001.m/pp_sys.c	Mon Jul 03 00:05:18 1995
--- perl5/pp_sys.c	Sun Jul 02 23:40:58 1995
***************
*** 1210,1216 ****
  	DIE("ioctl is not implemented");
  #endif
      else
! #ifdef DOSISH
  	DIE("fcntl is not implemented");
  #else
  #   ifdef HAS_FCNTL
--- 1210,1216 ----
  	DIE("ioctl is not implemented");
  #endif
      else
! #if defined(DOSISH) && !defined(OS2)
  	DIE("fcntl is not implemented");
  #else
  #   ifdef HAS_FCNTL
***************
*** 1455,1463 ****
  
  PP(pp_accept)
  {
-     struct sockaddr_in saddr;	/* use a struct to avoid alignment problems */
      dSP; dTARGET;
  #ifdef HAS_SOCKET
      GV *ngv;
      GV *ggv;
      register IO *nstio;
--- 1455,1463 ----
  
  PP(pp_accept)
  {
      dSP; dTARGET;
  #ifdef HAS_SOCKET
+     struct sockaddr_in saddr;	/* use a struct to avoid alignment problems */
      GV *ngv;
      GV *ggv;
      register IO *nstio;
***************
*** 2675,2681 ****
      Signal_t (*ihand)();     /* place to save signal during system() */
      Signal_t (*qhand)();     /* place to save signal during system() */
  
! #if defined(HAS_FORK) && !defined(VMS)
      if (SP - MARK == 1) {
  	if (tainting) {
  	    char *junk = SvPV(TOPs, na);
--- 2675,2681 ----
      Signal_t (*ihand)();     /* place to save signal during system() */
      Signal_t (*qhand)();     /* place to save signal during system() */
  
! #if defined(HAS_FORK) && !defined(VMS) && !defined(OS2)
      if (SP - MARK == 1) {
  	if (tainting) {
  	    char *junk = SvPV(TOPs, na);
***************
*** 2900,2906 ****
  {
      dSP;
  
! #if defined(MSDOS) || !defined(HAS_TIMES)
      DIE("times not implemented");
  #else
      EXTEND(SP, 4);
--- 2900,2906 ----
  {
      dSP;
  
! #ifndef HAS_TIMES
      DIE("times not implemented");
  #else
      EXTEND(SP, 4);
*** f:/perl5.001.m/proto.h	Mon Jul 03 00:07:44 1995
--- perl5/proto.h	Sun Jul 02 23:45:36 1995
***************
*** 228,233 ****
--- 228,238 ----
  long	my_ntohl _((long l));
  #endif
  void	my_unexec _((void));
+ #if defined(MYMALLOC) && defined(HIDEMYMALLOC)
+ extern Malloc_t malloc _((MEM_SIZE));
+ extern Malloc_t realloc _((Malloc_t, MEM_SIZE));
+ extern Free_t   free _((Malloc_t));
+ #endif
  OP*	newANONLIST _((OP* op));
  OP*	newANONHASH _((OP* op));
  OP*	newANONSUB _((I32 floor, OP* block));
*** f:/perl5.001.m/util.c	Mon Jul 03 00:05:22 1995
--- perl5/util.c	Sun Jul 02 23:41:00 1995
***************
*** 1363,1369 ****
      return fdopen(p[this], mode);
  }
  #else
! #ifdef atarist
  FILE *popen();
  FILE *
  my_popen(cmd,mode)
--- 1363,1369 ----
      return fdopen(p[this], mode);
  }
  #else
! #if defined(atarist) || defined(OS2)
  FILE *popen();
  FILE *
  my_popen(cmd,mode)
***************
*** 1420,1427 ****
  }
  #endif
  
! #ifndef DOSISH
! #ifndef VMS /* VMS' my_pclose() is in VMS.c */
  I32
  my_pclose(ptr)
  FILE *ptr;
--- 1420,1426 ----
  }
  #endif
  
! #if  !defined(DOSISH) && !defined(VMS)  /* VMS' my_popen() is in VMS.c */
  I32
  my_pclose(ptr)
  FILE *ptr;
***************
*** 1450,1456 ****
      signal(SIGQUIT, qstat);
      return(pid < 0 ? pid : status);
  }
! #endif /* !VMS */
  I32
  wait4pid(pid,statusp,flags)
  int pid;
--- 1449,1457 ----
      signal(SIGQUIT, qstat);
      return(pid < 0 ? pid : status);
  }
! #endif /* !DOSISH */
! 
! #if  !defined(DOSISH) || defined(OS2)
  I32
  wait4pid(pid,statusp,flags)
  int pid;
***************
*** 1524,1530 ****
      return;
  }
  
! #ifdef atarist
  int pclose();
  I32
  my_pclose(ptr)
--- 1525,1531 ----
      return;
  }
  
! #if defined(atarist) || defined(OS2)
  int pclose();
  I32
  my_pclose(ptr)
