Added 'c'-flag

This commit is contained in:
ceriel 1987-01-19 09:36:35 +00:00
parent 4489801c4f
commit 0efc7ae07d

View file

@ -14,6 +14,7 @@ static char RcsId[] = "$Header$";
* t: print contents of archive * t: print contents of archive
* p: print named files * p: print named files
* l: temporaries in current directory instead of /tmp * l: temporaries in current directory instead of /tmp
* c: don't give "create" message
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -68,6 +69,7 @@ BOOL show_fl;
BOOL pr_fl; BOOL pr_fl;
BOOL rep_fl; BOOL rep_fl;
BOOL del_fl; BOOL del_fl;
BOOL nocr_fl;
BOOL local_fl; BOOL local_fl;
int ar_fd; int ar_fd;
@ -86,9 +88,9 @@ usage()
error(TRUE, "usage: %s %s archive [file] ...\n", error(TRUE, "usage: %s %s archive [file] ...\n",
progname, progname,
#ifdef AAL #ifdef AAL
"[adrtxvl]" "[acdrtxvl]"
#else #else
"[adprtxvl]" "[acdprtxvl]"
#endif #endif
); );
} }
@ -148,7 +150,7 @@ register int mode;
if ((fd = open(name, mode)) < 0) { if ((fd = open(name, mode)) < 0) {
if (mode == APPEND) { if (mode == APPEND) {
close(open_archive(name, CREATE)); close(open_archive(name, CREATE));
error(FALSE, "%s: creating %s\n", progname, name); if (!nocr_fl) error(FALSE, "%s: creating %s\n", progname, name);
return open_archive(name, APPEND); return open_archive(name, APPEND);
} }
error(TRUE, "cannot open %s\n", name); error(TRUE, "cannot open %s\n", name);
@ -193,6 +195,9 @@ char *argv[];
case 'a' : case 'a' :
app_fl = TRUE; app_fl = TRUE;
break; break;
case 'c' :
nocr_fl = TRUE;
break;
#ifndef AAL #ifndef AAL
case 'p' : case 'p' :
pr_fl = TRUE; pr_fl = TRUE;