aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff
diff options
context:
space:
mode:
authorPiotr Pawel Stefaniak <pstef@FreeBSD.org>2021-09-04 23:44:26 +0000
committerPiotr Pawel Stefaniak <pstef@FreeBSD.org>2021-09-15 23:36:41 +0000
commitb5541f456d641d23e0c46874daff0b62552bf3cb (patch)
tree79c755f231c9e04bc87ca6555fef8aedbb5b2cc5 /usr.bin/diff
parent03582021117f05fa562a2a43028b931ec21c5237 (diff)
downloadsrc-b5541f456d641d23e0c46874daff0b62552bf3cb.tar.gz
src-b5541f456d641d23e0c46874daff0b62552bf3cb.zip
Diffstat (limited to 'usr.bin/diff')
-rw-r--r--usr.bin/diff/diff.c23
-rw-r--r--usr.bin/diff/diff.h8
2 files changed, 16 insertions, 15 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index bfd391a4e3dd..03eb16211e86 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$");
#include "diff.h"
#include "xmalloc.h"
-int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag;
-int diff_format, diff_context, status, ignore_file_case, suppress_common;
+bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag;
+bool ignore_file_case, suppress_common;
+int diff_format, diff_context, status;
int tabsize = 8, width = 130;
char *start, *ifdefname, *diffargs, *label[2], *ignore_pats;
char *group_format = NULL;
@@ -147,7 +148,6 @@ main(int argc, char **argv)
case 'c':
if (FORMAT_MISMATCHED(D_CONTEXT))
conflicting_format();
- cflag = 1;
diff_format = D_CONTEXT;
if (optarg != NULL) {
l = strtol(optarg, &ep, 10);
@@ -199,10 +199,10 @@ main(int argc, char **argv)
usage();
break;
case 'l':
- lflag = 1;
+ lflag = true;
break;
case 'N':
- Nflag = 1;
+ Nflag = true;
break;
case 'n':
if (FORMAT_MISMATCHED(D_NREVERSE))
@@ -213,10 +213,10 @@ main(int argc, char **argv)
dflags |= D_PROTOTYPE;
break;
case 'P':
- Pflag = 1;
+ Pflag = true;
break;
case 'r':
- rflag = 1;
+ rflag = true;
break;
case 'q':
if (FORMAT_MISMATCHED(D_BRIEF))
@@ -227,10 +227,10 @@ main(int argc, char **argv)
start = optarg;
break;
case 's':
- sflag = 1;
+ sflag = true;
break;
case 'T':
- Tflag = 1;
+ Tflag = true;
break;
case 't':
dflags |= D_EXPANDTABS;
@@ -251,7 +251,6 @@ main(int argc, char **argv)
dflags |= D_IGNOREBLANKS;
break;
case 'W':
- Wflag = 1;
width = (int) strtonum(optarg, 1, INT_MAX, &errstr);
if (errstr) {
warnx("Invalid argument for width");
@@ -278,10 +277,10 @@ main(int argc, char **argv)
case OPT_HORIZON_LINES:
break; /* XXX TODO for compatibility with GNU diff3 */
case OPT_IGN_FN_CASE:
- ignore_file_case = 1;
+ ignore_file_case = true;
break;
case OPT_NO_IGN_FN_CASE:
- ignore_file_case = 0;
+ ignore_file_case = false;
break;
case OPT_NORMAL:
if (FORMAT_MISMATCHED(D_NORMAL))
diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h
index 28d08288e1e9..04e75e631954 100644
--- a/usr.bin/diff/diff.h
+++ b/usr.bin/diff/diff.h
@@ -33,6 +33,8 @@
*/
#include <sys/types.h>
+
+#include <stdbool.h>
#include <regex.h>
/*
@@ -90,9 +92,9 @@ struct excludes {
struct excludes *next;
};
-extern int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag;
-extern int diff_format, diff_context, status, ignore_file_case;
-extern int suppress_common;
+extern bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag;
+extern bool ignore_file_case, suppress_common;
+extern int diff_format, diff_context, status;
extern int tabsize, width;
extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats;
extern char *group_format;