home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
ARCH
/
PAX20-2
/
PATCHES.OS2
< prev
next >
Wrap
Text File
|
1993-12-24
|
33KB
|
1,277 lines
Only in new: README.OS2
Only in new: Makefile
Only in new: pax.def
Only in new: config.h
Only in new: diskacc2.c
Only in new: diskacc2.h
Only in new: disktape.c
Only in new: disktape.h
diff -cb orig/append.c new/append.c
*** orig/append.c Mon Dec 18 10:24:14 1989
--- new/append.c Fri Dec 24 16:36:08 1993
***************
*** 32,38 ****
* patch1: Added some additional support for MS-DOS
*
* Revision 2.0.0.4 89/10/30 07:42:36 mark
! * Added <sys/mtio.h> for MSDOS
*
* Revision 2.0.0.3 89/10/13 02:34:15 mark
* Beta Test Freeze
--- 32,38 ----
* patch1: Added some additional support for MS-DOS
*
* Revision 2.0.0.4 89/10/30 07:42:36 mark
! * Added <sys/mtio.h> for MS-DOS
*
* Revision 2.0.0.3 89/10/13 02:34:15 mark
* Beta Test Freeze
diff -cb orig/buffer.c new/buffer.c
*** orig/buffer.c Mon Dec 18 10:25:38 1989
--- new/buffer.c Sat Dec 30 15:48:42 1989
***************
*** 673,679 ****
bufend += got;
} else if (got < 0) {
failed = -1;
! warnarch(strerror(), (OFFSET) 0 - (bufend - bufidx));
} else {
++areof;
}
--- 673,679 ----
bufend += got;
} else if (got < 0) {
failed = -1;
! warnarch(strerror(), (OFFSET) 0L - (OFFSET) (bufend - bufidx));
} else {
++areof;
}
diff -cb orig/cpio.c new/cpio.c
*** orig/cpio.c Mon Dec 18 10:29:26 1989
--- new/cpio.c Fri Dec 24 17:30:46 1993
***************
*** 187,198 ****
}
}
! #ifdef MSDOS
setmode(fileno(msgfile), O_TEXT);
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* MSDOS */
if (f_create + f_pass + f_extract != 1) {
usage();
--- 187,198 ----
}
}
! #ifdef PC
setmode(fileno(msgfile), O_TEXT);
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* PC */
if (f_create + f_pass + f_extract != 1) {
usage();
***************
*** 244,251 ****
--- 244,267 ----
#endif
{
DBUG_ENTER("usage");
+ #ifdef PC
+ printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
+
+ printf("\r\nUsage: %s -o[Bacv]\r\n", myname);
+ printf(" %s -i[Bcdmrtuvf] [pattern...]\r\n", myname);
+ printf(" %s -p[adlmruv] directory\r\n", myname);
+
+ printf("\r\nUse the nonstandard option \"-D file\" for files as input/output archives."
+ "\r\nRename CPIO.EXE to PAX.EXE or TAR.EXE to get the PAX or TAR user interface.\r\n");
+
+ #ifdef DISKACC
+ printf("\r\nUse the option -D with drive letter arguments to access Unix floppy"
+ "\r\ndisks with cpio archives. The disk type is automatically detected.\r\n");
+ #endif
+ #else
fprintf(stderr, "Usage: %s -o[Bacv]\n", myname);
fprintf(stderr, " %s -i[Bcdmrtuvf] [pattern...]\n", myname);
fprintf(stderr, " %s -p[adlmruv] directory\n", myname);
+ #endif
exit(1);
}
diff -cb orig/fileio.c new/fileio.c
*** orig/fileio.c Mon Dec 18 10:27:52 1989
--- new/fileio.c Fri Dec 24 17:09:54 1993
***************
*** 30,36 ****
*
* $Log: fileio.c,v $
* Revision 2.0.0.4 89/10/30 07:51:34 mark
! * Added call to dio_to_binary to support real character devices under MSDOS.
*
* Revision 2.0.0.3 89/10/13 02:34:59 mark
* Beta Test Freeze
--- 30,36 ----
*
* $Log: fileio.c,v $
* Revision 2.0.0.4 89/10/30 07:51:34 mark
! * Added call to dio_to_binary to support real character devices under MS-DOS.
*
* Revision 2.0.0.3 89/10/13 02:34:59 mark
* Beta Test Freeze
***************
*** 89,95 ****
archivefd = STDOUT;
}
} else if (mode == AR_READ) {
! archivefd = OPEN2(ar_file, O_RDONLY | O_BINARY);
bufend = bufidx = bufstart; /* set up for initial read */
} else if (mode == AR_WRITE) {
archivefd = OPEN3(ar_file, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
--- 89,95 ----
archivefd = STDOUT;
}
} else if (mode == AR_READ) {
! archivefd = OPEN(ar_file, O_RDONLY | O_BINARY);
bufend = bufidx = bufstart; /* set up for initial read */
} else if (mode == AR_WRITE) {
archivefd = OPEN3(ar_file, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
***************
*** 99,110 ****
bufend = bufidx = bufstart; /* set up for initial read */
}
! #ifndef MSDOS
! if (archivefd < 0) {
! warnarch(strerror(), (OFFSET) 0);
! DBUG_RETURN(-1);
! }
! #else /* MSDOS */
if (dio_open_check(ar_file) < 0) {
if (archivefd >= 0) {
warnarch(strerror(), (OFFSET) 0);
--- 99,105 ----
bufend = bufidx = bufstart; /* set up for initial read */
}
! #if defined(PC) && defined(DIO)
if (dio_open_check(ar_file) < 0) {
if (archivefd >= 0) {
warnarch(strerror(), (OFFSET) 0);
***************
*** 119,125 ****
if (dio_to_binary(archivefd) < 0) {
DBUG_RETURN(-1);
}
! #endif /* MSDOS */
++arvolume;
DBUG_RETURN(0);
--- 114,125 ----
if (dio_to_binary(archivefd) < 0) {
DBUG_RETURN(-1);
}
! #else
! if (archivefd < 0) {
! warnarch(strerror(), (OFFSET) 0);
! DBUG_RETURN(-1);
! }
! #endif /* PC */
++arvolume;
DBUG_RETURN(0);
***************
*** 256,261 ****
--- 256,262 ----
perm = asb->sb_mode & S_IPERM;
switch (asb->sb_mode & S_IFMT) {
+ #ifndef PC
#ifdef S_IFBLK
case S_IFBLK:
#endif /* S_IFBLK */
***************
*** 296,301 ****
--- 297,303 ----
DBUG_RETURN(0);
break;
#endif /* S_IFCHR */
+ #endif
case S_IFDIR:
if (exists) {
***************
*** 386,396 ****
exists = 0;
}
}
! if ((fd = creat(name, (int) perm)) < 0) {
if (errno == ENOENT) {
if (f_dir_create) {
if (dirneed(name) < 0 ||
! (fd = creat(name, (int) perm)) < 0) {
warn(name, strerror());
DBUG_RETURN(-1);
}
--- 388,399 ----
exists = 0;
}
}
! if ((fd = open(name, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, (int) perm)) < 0) {
if (errno == ENOENT) {
if (f_dir_create) {
if (dirneed(name) < 0 ||
! (fd = open(name, O_RDWR|O_CREAT|O_TRUNC|O_BINARY,
! (int) perm)) < 0) {
warn(name, strerror());
DBUG_RETURN(-1);
}
diff -cb orig/func.h new/func.h
*** orig/func.h Mon Dec 18 10:28:52 1989
--- new/func.h Fri Dec 24 17:06:40 1993
***************
*** 79,91 ****
struct group *getgrgid();
struct group *getgrnam();
struct passwd *getpwuid();
! char *getenv(char *);
Link *islink(char *, Stat *);
char *finduname(UIDTYPE);
char *findgname(GIDTYPE);
GIDTYPE findgid(char *);
UIDTYPE finduid(char *);
! char *malloc();
char *index(char *, char);
char *rindex(char *, char);
--- 79,91 ----
struct group *getgrgid();
struct group *getgrnam();
struct passwd *getpwuid();
! char *getenv(const char *);
Link *islink(char *, Stat *);
char *finduname(UIDTYPE);
char *findgname(GIDTYPE);
GIDTYPE findgid(char *);
UIDTYPE finduid(char *);
! void *malloc();
char *index(char *, char);
char *rindex(char *, char);
***************
*** 99,105 ****
int (*signal()) ();
#endif /* VOIDSIG */
! #ifdef MSDOS
extern int dio_write(int drive,char *from_buf,unsigned int from_cnt);
extern int dio_read(int drive,char *to_buf,unsigned int to_cnt);
extern int dio_open_check(char *s);
--- 99,105 ----
int (*signal()) ();
#endif /* VOIDSIG */
! #if defined(PC) && defined(DIO)
extern int dio_write(int drive,char *from_buf,unsigned int from_cnt);
extern int dio_read(int drive,char *to_buf,unsigned int to_cnt);
extern int dio_open_check(char *s);
***************
*** 108,114 ****
extern int dio_close(int h);
extern long dio_lseek(int h,long o,int r);
extern void dio_str(char *s);
! #endif /* MSDOS */
#else /* !__STDC__ */
--- 108,114 ----
extern int dio_close(int h);
extern long dio_lseek(int h,long o,int r);
extern void dio_str(char *s);
! #endif /* PC */
#else /* !__STDC__ */
***************
*** 181,187 ****
extern int (*signal()) ();
#endif
! #ifdef MSDOS
extern int dio_write();
extern int dio_read();
extern int dio_open_check();
--- 181,187 ----
extern int (*signal()) ();
#endif
! #if defined(PC) && defined(DIO)
extern int dio_write();
extern int dio_read();
extern int dio_open_check();
***************
*** 190,202 ****
extern int dio_close();
extern long dio_lseek();
extern void dio_str();
! #endif /* MSDOS */
! #ifndef /* STRTOK */
extern char *strtok();
#endif /* STRTOK */
#endif /* __STDC__ */
#endif /* _PAX_FUNC_H */
-
-
--- 190,200 ----
extern int dio_close();
extern long dio_lseek();
extern void dio_str();
! #endif /* PC */
! #ifndef STRTOK
extern char *strtok();
#endif /* STRTOK */
#endif /* __STDC__ */
#endif /* _PAX_FUNC_H */
diff -cb orig/limits.h new/limits.h
*** orig/limits.h Mon Dec 18 10:30:06 1989
--- new/limits.h Sun Oct 28 17:20:52 1990
***************
*** 51,57 ****
#ifndef NAME_MAX
/* This should be 32 for BSD systems */
! #define NAME_MAX 14 /* Max number of bytes in a filename */
#endif /* NAME_MAX */
#endif /* _PAX_LIMITS_H */
--- 51,57 ----
#ifndef NAME_MAX
/* This should be 32 for BSD systems */
! #define NAME_MAX 255 /* Max number of bytes in a filename */
#endif /* NAME_MAX */
#endif /* _PAX_LIMITS_H */
diff -cb orig/list.c new/list.c
*** orig/list.c Mon Dec 18 10:26:28 1989
--- new/list.c Fri Dec 24 16:24:48 1993
***************
*** 398,404 ****
struct tm *atm;
int i;
Link *link;
! int mode;
#ifdef S_IFLNK
char symnam[PATH_MAX];
#endif
--- 398,404 ----
struct tm *atm;
int i;
Link *link;
! unsigned mode;
#ifdef S_IFLNK
char symnam[PATH_MAX];
#endif
***************
*** 462,468 ****
if (f_verbose) {
atm = localtime(&asb->sb_mtime);
pr_mode(asb->sb_mode);
! fprintf(msgfile, " %d/%d %6ld %3s %2d %02d:%02d %4d %s",
asb->sb_uid, asb->sb_gid, asb->sb_size,
monnames[atm->tm_mon], atm->tm_mday, atm->tm_hour,
atm->tm_min, atm->tm_year + 1900, name);
--- 462,468 ----
if (f_verbose) {
atm = localtime(&asb->sb_mtime);
pr_mode(asb->sb_mode);
! fprintf(msgfile, " %3d/%-3d %6ld %3s %2d %02d:%02d %4d %s",
asb->sb_uid, asb->sb_gid, asb->sb_size,
monnames[atm->tm_mon], atm->tm_mday, atm->tm_hour,
atm->tm_min, atm->tm_year + 1900, name);
***************
*** 538,543 ****
--- 538,544 ----
pr_mode(asb->sb_mode);
fprintf(msgfile, " %3d", asb->sb_nlink);
atm = localtime(&asb->sb_mtime);
+ #ifndef PC
if (pwp = getpwuid((UIDTYPE) USH(asb->sb_uid))) {
fprintf(msgfile, " %-8s", pwp->pw_name);
} else {
***************
*** 548,553 ****
--- 549,555 ----
} else {
fprintf(msgfile, " %-8u", USH(asb->sb_gid));
}
+ #endif
switch (asb->sb_mode & S_IFMT) {
#ifdef S_IFBLK
diff -cb orig/msdos.c new/msdos.c
*** orig/msdos.c Mon Dec 18 10:26:40 1989
--- new/msdos.c Fri Dec 24 16:36:34 1993
***************
*** 10,19 ****
* under MS-DOS.
*
* NOTE: Before these routines can be used to read/write directly to
! * the disk, bypassing the logical file structure, MSDOS MUST know
* what kind of disk is in the drive you intend to write to. This can
* be accomplished by putting a formatted disk in the drive of
! * interest and doing a DIR on it. MSDOS then remembers the disk type
* for a while.
*
* WARNING: DISABLING THE BUILT IN CHECK AND CALLING THESE ROUTINES
--- 10,19 ----
* under MS-DOS.
*
* NOTE: Before these routines can be used to read/write directly to
! * the disk, bypassing the logical file structure, MS-DOS MUST know
* what kind of disk is in the drive you intend to write to. This can
* be accomplished by putting a formatted disk in the drive of
! * interest and doing a DIR on it. MS-DOS then remembers the disk type
* for a while.
*
* WARNING: DISABLING THE BUILT IN CHECK AND CALLING THESE ROUTINES
***************
*** 57,72 ****
/* Headers */
#include "pax.h"
! #ifdef MSDOS
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
- #include <string.h>
#include <errno.h>
#include <dos.h>
/* Function Prototypes */
#ifdef __STDC__
--- 57,74 ----
/* Headers */
#include "pax.h"
!
! #ifdef PC
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <dos.h>
+ #ifdef DIO
+
/* Function Prototypes */
#ifdef __STDC__
***************
*** 108,114 ****
static union REGS reg;
static union REGS rreg;
! #ifdef M_I86LM
static struct SREGS sreg;
#endif /* !M_I86LM */
--- 110,116 ----
static union REGS reg;
static union REGS rreg;
! #if defined(M_I86LM) || defined(M_I86CM)
static struct SREGS sreg;
#endif /* !M_I86LM */
***************
*** 142,148 ****
reg.x.ax = drive;
reg.x.dx = secnum;
reg.x.cx = secknt;
! #ifdef M_I86LM
reg.x.bx = FP_OFF(buf);
sreg.ds = FP_SEG(buf);
int86x(0x26, ®, &rreg, &sreg);
--- 144,150 ----
reg.x.ax = drive;
reg.x.dx = secnum;
reg.x.cx = secknt;
! #if defined(M_I86LM) || defined(M_I86CM)
reg.x.bx = FP_OFF(buf);
sreg.ds = FP_SEG(buf);
int86x(0x26, ®, &rreg, &sreg);
***************
*** 165,178 ****
unsigned int secnum;
unsigned int secknt;
unsigned int *err;
! unsigned int *buf;
{
DBUG_ENTER("dio_adr");
rwsec = secnum;
reg.x.ax = drive;
reg.x.dx = secnum;
reg.x.cx = secknt;
! #ifdef M_I86LM
reg.x.bx = FP_OFF(buf);
sreg.ds = FP_SEG(buf);
int86x(0x25, ®, &rreg, &sreg);
--- 167,180 ----
unsigned int secnum;
unsigned int secknt;
unsigned int *err;
! char *buf;
{
DBUG_ENTER("dio_adr");
rwsec = secnum;
reg.x.ax = drive;
reg.x.dx = secnum;
reg.x.cx = secknt;
! #if defined(M_I86LM) || defined(M_I86CM)
reg.x.bx = FP_OFF(buf);
sreg.ds = FP_SEG(buf);
int86x(0x25, ®, &rreg, &sreg);
***************
*** 344,350 ****
* written */
unsigned int from_cnt; /* number of bytes to write */
{
! unsigned int amt:
unsigned int err;
unsigned int nn;
unsigned int fquo;
--- 346,352 ----
* written */
unsigned int from_cnt; /* number of bytes to write */
{
! unsigned int amt;
unsigned int err;
unsigned int nn;
unsigned int fquo;
***************
*** 637,642 ****
--- 639,645 ----
DBUG_RETURN (fptr);
}
+ #endif
static struct passwd npwd = {"", "", 0, 0, 0, "", "", "", ""};
static char gmem1[] = "";
***************
*** 714,717 ****
return(0);
}
! #endif /* MSDOS */
--- 717,720 ----
return(0);
}
! #endif /* PC */
diff -cb orig/namelist.c new/namelist.c
*** orig/namelist.c Mon Dec 18 10:27:38 1989
--- new/namelist.c Fri Dec 24 16:23:34 1993
***************
*** 126,134 ****
DBUG_ENTER("add_name");
! #ifdef MSDOS
dio_str(name);
! #endif /* MSDOS */
i = strlen(name);
p = (struct nm_list *) malloc((unsigned) (i + sizeof(struct nm_list)));
--- 126,134 ----
DBUG_ENTER("add_name");
! #if defined(PC) && defined(DIO)
dio_str(name);
! #endif /* PC */
i = strlen(name);
p = (struct nm_list *) malloc((unsigned) (i + sizeof(struct nm_list)));
***************
*** 432,440 ****
}
} while (err < 0);
! #ifdef MSDOS
dio_str(name);
! #endif /* MSDOS */
DBUG_RETURN(0);
}
--- 432,440 ----
}
} while (err < 0);
! #if defined(PC) && defined(DIO)
dio_str(name);
! #endif /* PC */
DBUG_RETURN(0);
}
diff -cb orig/names.c new/names.c
*** orig/names.c Mon Dec 18 10:29:10 1989
--- new/names.c Fri Dec 24 16:23:02 1993
***************
*** 53,59 ****
/* Internal Identifiers */
! #ifndef MSDOS
static UIDTYPE saveuid = -993;
static char saveuname[TUNMLEN];
static UIDTYPE my_uid = -993;
--- 53,59 ----
/* Internal Identifiers */
! #ifndef PC
static UIDTYPE saveuid = -993;
static char saveuname[TUNMLEN];
static UIDTYPE my_uid = -993;
***************
*** 61,67 ****
static GIDTYPE savegid = -993;
static char savegname[TGNMLEN];
static GIDTYPE my_gid = -993;
! #else /* MSDOS */
static int saveuid = 0;
static char saveuname[TUNMLEN] = "";
static int my_uid = 0;
--- 61,67 ----
static GIDTYPE savegid = -993;
static char savegname[TGNMLEN];
static GIDTYPE my_gid = -993;
! #else /* PC */
static int saveuid = 0;
static char saveuname[TUNMLEN] = "";
static int my_uid = 0;
***************
*** 69,75 ****
static int savegid = 0;
static char savegname[TGNMLEN] = "";
static int my_gid = 0;
! #endif /* MSDOS */
/* finduname - find a user or group name from a uid or gid
*
--- 69,75 ----
static int savegid = 0;
static char savegname[TGNMLEN] = "";
static int my_gid = 0;
! #endif /* PC */
/* finduname - find a user or group name from a uid or gid
*
diff -cb orig/pass.c new/pass.c
*** orig/pass.c Mon Dec 18 10:27:40 1989
--- new/pass.c Sat Dec 30 16:09:30 1989
***************
*** 141,147 ****
char to[PATH_MAX + 1];
DBUG_ENTER("passitem");
! if (nameopt(strcat(strcat(strcpy(to, dir), "/"), from)) < 0) {
DBUG_RETURN(-1);
}
if (asb->sb_nlink > 1) {
--- 141,151 ----
char to[PATH_MAX + 1];
DBUG_ENTER("passitem");
! strcpy(to, dir);
! strcat(to, "/");
! strcat(to, from);
!
! if (nameopt(to) < 0) {
DBUG_RETURN(-1);
}
if (asb->sb_nlink > 1) {
diff -cb orig/pax.c new/pax.c
*** orig/pax.c Mon Dec 18 10:27:14 1989
--- new/pax.c Fri Dec 24 17:31:28 1993
***************
*** 160,179 ****
#endif
{
! #ifdef MSDOS
char *tmp;
! extern int _fmode;
! #endif /* MSDOS */
DBUG_ENTER("main");
DBUG_PROCESS(argv[0]);
! #ifdef MSDOS
! _fmode = O_BINARY;
setmode(fileno(stdin), O_BINARY);
setmode(fileno(stdout), O_BINARY);
/* strip the pathname off of the name of the executable */
dio_str(argv[0]);
if ((myname = strrchr(argv[0], '/')) != (char *)NULL) {
myname++;
} else if ((myname = strrchr(argv[0], '\\')) != (char *)NULL) {
--- 160,184 ----
#endif
{
! #ifdef PC
char *tmp;
! #endif /* PC */
!
! #ifdef __EMX__
! _response(&argc, &argv);
! _wildcard(&argc, &argv);
! #endif
DBUG_ENTER("main");
DBUG_PROCESS(argv[0]);
! #ifdef PC
setmode(fileno(stdin), O_BINARY);
setmode(fileno(stdout), O_BINARY);
/* strip the pathname off of the name of the executable */
+ #ifdef DIO
dio_str(argv[0]);
+ #endif
if ((myname = strrchr(argv[0], '/')) != (char *)NULL) {
myname++;
} else if ((myname = strrchr(argv[0], '\\')) != (char *)NULL) {
***************
*** 181,197 ****
} else {
myname = argv[0];
}
! if ((tmp = strrchr(myname, '.')) != (char *) NULL)
*tmp = '\0';
}
! #else /* !MSDOS */
/* strip the pathname off of the name of the executable */
if ((myname = rindex(argv[0], '/')) != (char *) NULL) {
myname++;
} else {
myname = argv[0];
}
! #endif /* MSDOS */
/* set up for collecting other command line arguments */
name_init(argc, argv);
--- 186,202 ----
} else {
myname = argv[0];
}
! if ((tmp = strrchr(myname, '.')) != (char *) NULL) {
*tmp = '\0';
}
! #else /* !PC */
/* strip the pathname off of the name of the executable */
if ((myname = rindex(argv[0], '/')) != (char *) NULL) {
myname++;
} else {
myname = argv[0];
}
! #endif /* PC */
/* set up for collecting other command line arguments */
name_init(argc, argv);
***************
*** 205,214 ****
/* open terminal for interactive queries */
ttyf = open_tty();
! if (strcmp(myname, "tar") == 0) {
tar_interface = 1;
do_tar(argc, argv);
! } else if (strcmp(myname, "cpio") == 0) {
cpio_interface = 1;
do_cpio(argc, argv);
} else {
--- 210,219 ----
/* open terminal for interactive queries */
ttyf = open_tty();
! if (stricmp(myname, "tar") == 0) {
tar_interface = 1;
do_tar(argc, argv);
! } else if (stricmp(myname, "cpio") == 0) {
cpio_interface = 1;
do_cpio(argc, argv);
} else {
***************
*** 375,383 ****
break;
case 'x':
! if (strcmp(optarg, "ustar") == 0) {
ar_format = TAR;
! } else if (strcmp(optarg, "cpio") == 0) {
ar_format = CPIO;
} else {
usage();
--- 380,388 ----
break;
case 'x':
! if (stricmp(optarg, "ustar") == 0) {
ar_format = TAR;
! } else if (stricmp(optarg, "cpio") == 0) {
ar_format = CPIO;
} else {
usage();
***************
*** 393,401 ****
}
}
! #ifdef MSDOS
setmode(fileno(msgfile), O_TEXT);
! #endif /* MSDOS */
if (blocksize == 0) {
blocking = 1;
--- 398,411 ----
}
}
! if ( strcmp(ar_file, "-") == 0
! && isatty(fileno(stdin))
! && isatty(fileno(stdout)) )
! usage();
!
! #ifdef PC
setmode(fileno(msgfile), O_TEXT);
! #endif /* PC */
if (blocksize == 0) {
blocking = 1;
***************
*** 412,422 ****
names_from_stdin++; /* args from stdin */
}
! #ifdef MSDOS
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* MSDOS */
open_archive(AR_WRITE);
create_archive();
--- 422,432 ----
names_from_stdin++; /* args from stdin */
}
! #ifdef PC
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* PC */
open_archive(AR_WRITE);
create_archive();
***************
*** 436,446 ****
names_from_stdin++; /* args from stdin */
}
! #ifdef MSDOS
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* MSDOS */
pass(dirname);
} else {
--- 446,456 ----
names_from_stdin++; /* args from stdin */
}
! #ifdef PC
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* PC */
pass(dirname);
} else {
***************
*** 622,634 ****
#endif
{
DBUG_ENTER("usage");
fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
myname);
fprintf(stderr, " %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
myname);
! fprintf(stderr, " %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n [-t device] [-x format] [pathname...]\n",
myname);
fprintf(stderr, " %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n",
myname);
exit(1);
}
--- 632,662 ----
#endif
{
DBUG_ENTER("usage");
+ #ifdef PC
+ printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
+
+ printf("\r\nUsage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\r\n", myname);
+ printf(" %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\r\n", myname);
+ printf(" %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\r\n"
+ " [-t device] [-x format] [pathname...]\r\n", myname);
+ printf(" %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\r\n", myname);
+
+ printf("\r\nRename PAX.EXE to TAR.EXE or CPIO.EXE to get the TAR or CPIO user interface.\r\n");
+
+ #ifdef DISKACC
+ printf("\r\nUse the option -t with drive letter arguments to access Unix floppy"
+ "\r\ndisks with tar or cpio archives. The disk type is automatically detected.\r\n");
+ #endif
+ #else
fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
myname);
fprintf(stderr, " %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
myname);
! fprintf(stderr, " %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n"
! " [-t device] [-x format] [pathname...]\n",
myname);
fprintf(stderr, " %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n",
myname);
+ #endif
exit(1);
}
diff -cb orig/pax.h new/pax.h
*** orig/pax.h Mon Dec 18 10:27:58 1989
--- new/pax.h Fri Dec 24 16:35:44 1993
***************
*** 43,58 ****
#include <sys/stat.h>
#include "regexp.h"
#include "dbug.h"
#ifdef __STDC_
# include <string.h>
# include <strlib.h>
#endif /* __STDC__ */
! #ifdef MSDOS
# include <sys/ioctl.h>
! #endif /* MSDOS */
#define DEF_TAR_FILE "/dev/rmt0"
#define TTY "/dev/tty"
#ifdef IOCTL
# include <sys/ioctl.h>
--- 43,65 ----
#include <sys/stat.h>
#include "regexp.h"
#include "dbug.h"
+
#ifdef __STDC_
# include <string.h>
# include <strlib.h>
#endif /* __STDC__ */
!
! /* #ifdef PC
# include <sys/ioctl.h>
! #endif /* PC */
+ #ifdef PC
+ #define DEF_TAR_FILE "archive.pax"
+ #define TTY "con"
+ #else
#define DEF_TAR_FILE "/dev/rmt0"
#define TTY "/dev/tty"
+ #endif
#ifdef IOCTL
# include <sys/ioctl.h>
***************
*** 72,84 ****
# include <sys/inode.h>
#endif /* XENIX */
! #ifndef MSDOS
# include <pwd.h>
# include <grp.h>
! #endif /* MSDOS */
#ifndef XENIX_286
# include <sys/file.h>
#endif /* XENIX_286 */
/* Defines */
--- 79,93 ----
# include <sys/inode.h>
#endif /* XENIX */
! #ifndef PC
# include <pwd.h>
# include <grp.h>
! #endif /* PC */
#ifndef XENIX_286
+ #ifndef PC
# include <sys/file.h>
+ #endif
#endif /* XENIX_286 */
/* Defines */
***************
*** 347,354 ****
--- 356,368 ----
extern char *optarg;
extern int optind;
+
+ #ifdef PC
+ #include <stdlib.h>
+ #else
extern int sys_nerr;
extern char *sys_errlist[];
extern int errno;
+ #endif
#endif /* _PAX_H */
Only in orig: pax.tar
diff -cb orig/port.h new/port.h
*** orig/port.h Mon Dec 18 10:30:02 1989
--- new/port.h Fri Dec 24 17:06:56 1993
***************
*** 47,53 ****
#define TERM_SIGNAL(status) ((status) & 0x7F)
#define TERM_VALUE(status) ((status) >> 8)
! #ifdef MSDOS
#include <io.h>
#define major(x) (0)
--- 47,53 ----
#define TERM_SIGNAL(status) ((status) & 0x7F)
#define TERM_VALUE(status) ((status) >> 8)
! #ifdef PC
#include <io.h>
#define major(x) (0)
***************
*** 73,82 ****
char **gr_mem;
};
! #endif /* MSDOS */
! #ifdef MSDOS
#define OPEN2(p,f) \
( (dio_open_check(p) < 0) ? dio_open2(p,f) : open(p,f) )
--- 73,84 ----
char **gr_mem;
};
! #endif /* PC */
! #ifdef PC
!
! #if defined(DIO)
#define OPEN2(p,f) \
( (dio_open_check(p) < 0) ? dio_open2(p,f) : open(p,f) )
***************
*** 91,97 ****
#define LSEEK(h,o,r) \
( (h < 0) ? dio_lseek(h,o,r) : lseek(h,o,r) )
! #else /* !MSDOS */
#define OPEN2(p,f) open(p,f)
#define OPEN3(p,f,m) open(p,f,m)
--- 93,105 ----
#define LSEEK(h,o,r) \
( (h < 0) ? dio_lseek(h,o,r) : lseek(h,o,r) )
! #elif defined(DISKACC)
!
! #if defined(PC) && defined(DISKACC)
! #include "disktape.h"
! #endif /* PC */
!
! #else
#define OPEN2(p,f) open(p,f)
#define OPEN3(p,f,m) open(p,f,m)
***************
*** 100,104 ****
#define WRITE(h,b,c) write(h,b,c)
#define LSEEK(h,o,r) lseek(h,o,r)
! #endif /* MSDOS */
#endif /* _PAX_PORT_H */
--- 108,116 ----
#define WRITE(h,b,c) write(h,b,c)
#define LSEEK(h,o,r) lseek(h,o,r)
! #endif
!
! #endif /* PC */
#endif /* _PAX_PORT_H */
+
+
diff -cb orig/tar.c new/tar.c
*** orig/tar.c Mon Dec 18 10:26:02 1989
--- new/tar.c Fri Dec 24 17:31:00 1993
***************
*** 186,203 ****
}
}
! #ifdef MSDOS
setmode(fileno(msgfile), O_TEXT);
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* MSDOS */
/* check command line argument sanity */
if (f_create + f_extract + f_list + f_append + f_newer != 1) {
(void) fprintf(stderr,
"%s: you must specify exactly one of the c, t, r, u or x options\n",
myname);
usage();
exit(EX_ARGSBAD);
}
--- 186,209 ----
}
}
! #ifdef PC
setmode(fileno(msgfile), O_TEXT);
if (names_from_stdin) {
setmode(fileno(stdin), O_TEXT);
}
! #endif /* PC */
/* check command line argument sanity */
if (f_create + f_extract + f_list + f_append + f_newer != 1) {
+ #ifdef PC
+ printf(
+ "\r\n%s: you must specify exactly one of the c, t, r, u or x options\r\n",
+ myname);
+ #else
(void) fprintf(stderr,
"%s: you must specify exactly one of the c, t, r, u or x options\n",
myname);
+ #endif
usage();
exit(EX_ARGSBAD);
}
***************
*** 347,356 ****
--- 353,379 ----
#endif
{
DBUG_ENTER("usage");
+ #ifdef PC
+ printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
+
+ printf("\r\nUsage: %s -c[bfvw] device block filename..\r\n", myname);
+ printf(" %s -r[bvw] device block [filename...]\r\n", myname);
+ printf(" %s -t[vf] device\r\n", myname);
+ printf(" %s -u[bvw] device block [filename...]\r\n", myname);
+ printf(" %s -x[flmovw] device [filename...]\r\n", myname);
+
+ printf("\r\nRename TAR.EXE to PAX.EXE or CPIO.EXE to get the PAX or CPIO user interface.\r\n");
+
+ #ifdef DISKACC
+ printf("\r\nUse the option f with drive letter arguments to access Unix floppy"
+ "\r\ndisks with tar archives. The disk type is automatically detected.\r\n");
+ #endif
+ #else
fprintf(stderr, "Usage: %s -c[bfvw] device block filename..\n", myname);
fprintf(stderr, " %s -r[bvw] device block [filename...]\n", myname);
fprintf(stderr, " %s -t[vf] device\n", myname);
fprintf(stderr, " %s -u[bvw] device block [filename...]\n", myname);
fprintf(stderr, " %s -x[flmovw] device [filename...]\n", myname);
+ #endif
exit(1);
}
diff -cb orig/ttyio.c new/ttyio.c
*** orig/ttyio.c Mon Dec 18 10:28:36 1989
--- new/ttyio.c Fri Dec 24 16:33:46 1993
***************
*** 96,104 ****
DBUG_RETURN(-1);
}
! #ifdef MSDOS
setmode(fd, O_TEXT);
! #endif /* MSDOS */
if (isatty(fd)) {
DBUG_RETURN(fd);
--- 96,104 ----
DBUG_RETURN(-1);
}
! #ifdef PC
setmode(fd, O_TEXT);
! #endif /* PC */
if (isatty(fd)) {
DBUG_RETURN(fd);
***************
*** 170,175 ****
--- 170,176 ----
answer[idx++] = c;
}
}
+ write(ttyf, "\r\n", 2);
if (got == 0) { /* got an EOF */
DBUG_RETURN(-1);
}
***************
*** 270,279 ****
myname, arvolume + 1, myname);
for (;;) {
ret = nextask(msg, answer, sizeof(answer));
! if (ret == -1 || strcmp(answer, "quit") == 0) {
fatal("Aborted");
}
! if (strcmp(answer, "go") == 0 && open_archive(mode) == 0) {
break;
}
}
--- 271,280 ----
myname, arvolume + 1, myname);
for (;;) {
ret = nextask(msg, answer, sizeof(answer));
! if (ret == -1 || stricmp(answer, "quit") == 0) {
fatal("Aborted");
}
! if (stricmp(answer, "go") == 0 && open_archive(mode) == 0) {
break;
}
}