summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>1995-01-12 22:09:40 +0000
committerhsu <hsu@FreeBSD.org>1995-01-12 22:09:40 +0000
commitb5ccaa010d78f402711c5dfe112cd078c08d8435 (patch)
tree4a908318d7f884e54582841828e1ec86e6fb35c0 /gnu/usr.bin/patch/inp.c
parent1b3a308b0eebda837c1b87bfdfa8e2c805b7f375 (diff)
downloadFreeBSD-src-b5ccaa010d78f402711c5dfe112cd078c08d8435.zip
FreeBSD-src-b5ccaa010d78f402711c5dfe112cd078c08d8435.tar.gz
Fix bug that created new files even when running in -C check mode.
Reviewed by: phk
Diffstat (limited to 'gnu/usr.bin/patch/inp.c')
-rw-r--r--gnu/usr.bin/patch/inp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gnu/usr.bin/patch/inp.c b/gnu/usr.bin/patch/inp.c
index c99054f..0d0e6af 100644
--- a/gnu/usr.bin/patch/inp.c
+++ b/gnu/usr.bin/patch/inp.c
@@ -1,6 +1,9 @@
-/* $Header: inp.c,v 2.0.1.1 88/06/03 15:06:13 lwall Locked $
+/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
+ *
+ * $Log: inp.c,v $
+ * Revision 1.1.1.1 1993/06/19 14:21:52 paul
+ * b-maked patch-2.10
*
- * $Log: inp.c,v $
* Revision 2.0.1.1 88/06/03 15:06:13 lwall
* patch10: made a little smarter about sccs files
*
@@ -81,15 +84,21 @@ char *filename;
Reg2 LINENUM iline;
char lbuf[MAXLINELEN];
int output_elsewhere = strcmp(filename, outname);
+ extern int check_patch;
statfailed = stat(filename, &filestat);
if (statfailed && ok_to_create_file) {
if (verbose)
say2("(Creating file %s...)\n",filename);
+ if (check_patch)
+ return TRUE;
makedirs(filename, TRUE);
close(creat(filename, 0666));
statfailed = stat(filename, &filestat);
}
+ if (statfailed && check_patch) {
+ fatal2("%s not found and in check_patch mode.", filename);
+ }
/* For nonexistent or read-only files, look for RCS or SCCS versions. */
if (statfailed
|| (! output_elsewhere
OpenPOWER on IntegriCloud