summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-11-26 08:57:42 +0000
committerphk <phk@FreeBSD.org>1994-11-26 08:57:42 +0000
commitef554cb3128c1d2330884ecc44decc6b6235e55f (patch)
tree8f244a970f89005c300734574a01cfa3f52c6ea5 /usr.sbin
parent9ea14d473c236bc560e1a058e11b8751b9f909b8 (diff)
downloadFreeBSD-src-ef554cb3128c1d2330884ecc44decc6b6235e55f.zip
FreeBSD-src-ef554cb3128c1d2330884ecc44decc6b6235e55f.tar.gz
Stefan Esser proved that I couldn't program, and Ollivier Robert that I
couldn't spell :-) Submitted by: Stefan Esser, Ollivier Robert
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ctm/ctm/ctm.c6
-rw-r--r--usr.sbin/ctm/ctm/ctm_pass1.c6
-rw-r--r--usr.sbin/ctm/ctm/ctm_pass2.c4
-rw-r--r--usr.sbin/ctm/ctm/ctm_pass3.c20
4 files changed, 21 insertions, 15 deletions
diff --git a/usr.sbin/ctm/ctm/ctm.c b/usr.sbin/ctm/ctm/ctm.c
index 90538ce..840361c 100644
--- a/usr.sbin/ctm/ctm/ctm.c
+++ b/usr.sbin/ctm/ctm/ctm.c
@@ -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++);
}
diff --git a/usr.sbin/ctm/ctm/ctm_pass1.c b/usr.sbin/ctm/ctm/ctm_pass1.c
index a1ffaf6..d778414 100644
--- a/usr.sbin/ctm/ctm/ctm_pass1.c
+++ b/usr.sbin/ctm/ctm/ctm_pass1.c
@@ -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 */
diff --git a/usr.sbin/ctm/ctm/ctm_pass2.c b/usr.sbin/ctm/ctm/ctm_pass2.c
index bf98e72..ef6202c 100644
--- a/usr.sbin/ctm/ctm/ctm_pass2.c
+++ b/usr.sbin/ctm/ctm/ctm_pass2.c
@@ -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
diff --git a/usr.sbin/ctm/ctm/ctm_pass3.c b/usr.sbin/ctm/ctm/ctm_pass3.c
index d6508be..814d680 100644
--- a/usr.sbin/ctm/ctm/ctm_pass3.c
+++ b/usr.sbin/ctm/ctm/ctm_pass3.c
@@ -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
}
OpenPOWER on IntegriCloud