Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175311817
D46717.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46717.id.diff
View Options
diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h
--- a/usr.bin/diff/diff.h
+++ b/usr.bin/diff/diff.h
@@ -50,6 +50,7 @@
#define D_BRIEF 6 /* Say if the files differ */
#define D_GFORMAT 7 /* Diff with defined changed group format */
#define D_SIDEBYSIDE 8 /* Side by side */
+#define D_QUIET 9 /* Don't output anything */
#define D_UNSET -2
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -276,7 +276,12 @@
case 'q':
if (FORMAT_MISMATCHED(D_BRIEF))
conflicting_format();
- diff_format = D_BRIEF;
+ if (diff_format == D_BRIEF) {
+ diff_format = D_QUIET;
+ /* If already D_QUITE, avoid getting more verbose. */
+ } else if (diff_format != D_QUIET) {
+ diff_format = D_BRIEF;
+ }
break;
case 'S':
start = optarg;
@@ -474,8 +479,10 @@
if (stat(argv[1], &stb2) == -1)
err(2, "%s", argv[1]);
}
- print_status(diffreg(argv[0], argv[1], dflags, 1), argv[0],
- argv[1], "");
+
+ if (diff_format != D_QUIET)
+ print_status(diffreg(argv[0], argv[1], dflags, 1),
+ argv[0], argv[1], "");
}
if (fflush(stdout) != 0)
err(2, "stdout");
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -415,7 +415,8 @@
goto closem;
}
- if (diff_format == D_BRIEF && ignore_pats == NULL &&
+ if ((diff_format == D_BRIEF || diff_format == D_QUIET) &&
+ ignore_pats == NULL &&
(flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|
D_SKIPBLANKLINES|D_STRIPCR)) == 0)
{
@@ -1107,7 +1108,8 @@
return;
}
proceed:
- if (*pflags & D_HEADER && diff_format != D_BRIEF) {
+ if (*pflags & D_HEADER &&
+ (diff_format != D_BRIEF && diff_format != D_QUIET)) {
printf("%s %s %s\n", diffargs, file1, file2);
*pflags &= ~D_HEADER;
}
@@ -1156,6 +1158,7 @@
anychange = 1;
switch (diff_format) {
case D_BRIEF:
+ case D_QUIET:
return;
case D_NORMAL:
case D_EDIT:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 10, 9:14 PM (47 m, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40511165
Default Alt Text
D46717.id.diff (1 KB)
Attached To
Mode
D46717: diff: support -qq to output absolutely nothing
Attached
Detach File
Event Timeline
Log In to Comment