Stefan Esser proved that I couldn't program, and Ollivier Robert that I
couldn't spell :-) Submitted by: Stefan Esser, Ollivier Robert
This commit is contained in:
parent
94c13683b4
commit
94fc076f56
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4816
@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id: ctm.c,v 1.4 1994/09/22 02:49:15 phk Exp $
|
||||
* $Id: ctm.c,v 1.5 1994/10/24 20:09:20 phk Exp $
|
||||
*
|
||||
* This is the client program of 'CTM'. It will apply a CTM-patch to a
|
||||
* collection of files.
|
||||
@ -77,14 +77,14 @@ main(int argc, char **argv)
|
||||
fprintf(stderr,"%d errors during option processing\n",stat);
|
||||
return Exit_Pilot;
|
||||
}
|
||||
stat = 0;
|
||||
stat = Exit_Done;
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if(!argc)
|
||||
stat |= Proc("-");
|
||||
|
||||
while(argc-- && !stat) {
|
||||
while(argc-- && stat != Exit_Done) {
|
||||
stat |= Proc(*argv++);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ctm_pass1.c,v 1.4 1994/09/22 02:49:18 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
#define BADREAD 1
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Pass1 -- Validate the incomming CTM-file.
|
||||
/* Pass1 -- Validate the incoming CTM-file.
|
||||
*/
|
||||
|
||||
int
|
||||
@ -28,7 +28,7 @@ Pass1(FILE *fd)
|
||||
int slashwarn=0;
|
||||
|
||||
if(Verbose>3)
|
||||
printf("Pass1 -- Checking integrity of incomming CTM-patch\n");
|
||||
printf("Pass1 -- Checking integrity of incoming CTM-patch\n");
|
||||
MD5Init (&ctx);
|
||||
|
||||
GETFIELD(p,' '); /* CTM_BEGIN */
|
||||
|
@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ctm_pass2.c,v 1.4 1994/09/22 02:49:19 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
#define BADREAD 32
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Pass2 -- Validate the incomming CTM-file.
|
||||
/* Pass2 -- Validate the incoming CTM-file.
|
||||
*/
|
||||
|
||||
int
|
||||
|
@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ctm_pass3.c,v 1.4 1994/09/22 02:49:20 phk Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
#define BADREAD 32
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Pass3 -- Validate the incomming CTM-file.
|
||||
/* Pass3 -- Validate the incoming CTM-file.
|
||||
*/
|
||||
|
||||
int
|
||||
@ -157,12 +157,18 @@ Pass3(FILE *fd)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(!strcmp(sp->Key,"DR") || !strcmp(sp->Key,"FR")) {
|
||||
if(0 > unlink(name)) {
|
||||
sprintf(buf,"rm -rf %s",name);
|
||||
system(buf);
|
||||
}
|
||||
if(!strcmp(sp->Key,"FR")) {
|
||||
if (0 = unlink(name))
|
||||
continue;
|
||||
}
|
||||
if(!strcmp(sp->Key,"DR")) {
|
||||
if (0 = rmdir(name))
|
||||
continue;
|
||||
#ifdef NOTDEF
|
||||
sprintf(buf,"rm -rf %s",name);
|
||||
system(buf);
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
WRONG
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user