summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorskd <skd@NetBSD.org>2005-03-25 23:00:55 +0000
committerskd <skd@NetBSD.org>2005-03-25 23:00:55 +0000
commit4f9669ed8d58191582fd1bc5a67fe39462315404 (patch)
tree640bca235a1184518f28fa1705475b3365a6080a /usr.bin/patch/patch.c
parentb279845eed08a04fbb1a291ddd7014bb21a7619b (diff)
add --dry-run like gnu patch.
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 7a2e041a9d5..e5be242443a 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $NetBSD: patch.c,v 1.22 2004/12/09 18:06:10 mycroft Exp $ */
+/* $NetBSD: patch.c,v 1.23 2005/03/25 23:00:55 skd Exp $ */
/* patch - a program to apply diffs to original files
*
@@ -25,7 +25,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: patch.c,v 1.22 2004/12/09 18:06:10 mycroft Exp $");
+__RCSID("$NetBSD: patch.c,v 1.23 2005/03/25 23:00:55 skd Exp $");
#endif /* not lint */
#include "INTERN.h"
@@ -83,6 +83,8 @@ main(int argc, char *argv[])
myuid = getuid();
+ check_only = FALSE;
+
/* Cons up the names of the temporary files. */
{
/* Directory for temporary files. */
@@ -398,10 +400,10 @@ decode_long_option(char *opt)
*/
static struct option options[] = {
{ "batch", 't' },
- { "check", 'C' },
{ "context", 'c' },
{ "debug", 'x' },
{ "directory", 'd' },
+ { "dry-run", 'C' },
{ "ed", 'e' },
{ "force", 'f' },
{ "forward", 'N' },
@@ -477,6 +479,9 @@ exclusive\n");
case 'c':
diff_type = CONTEXT_DIFF;
break;
+ case 'C':
+ check_only = TRUE;
+ break;
case 'd':
if (!*++s)
s = nextarg();