mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix exit status with -rq when there is a file in one directory but not another,
i.e., when print_only is called. Prior to this change, -rq was always returning 0. After this change it will return 1 if there is a difference between two directories. This fixes compatibility with GNU diff and unbreaks backwards compatibility expectations. Found when trying to extend diff_test:brief_format_test. MFC after: 2 months MFC with: r321076, r321077
This commit is contained in:
parent
4574a545d2
commit
2d920b13cb
1 changed files with 6 additions and 2 deletions
|
|
@ -134,16 +134,20 @@ diffdir(char *p1, char *p2, int flags)
|
|||
if (Nflag)
|
||||
diffit(dent1, path1, dirlen1, path2, dirlen2,
|
||||
flags);
|
||||
else
|
||||
else {
|
||||
print_only(path1, dirlen1, dent1->d_name);
|
||||
status = 1;
|
||||
}
|
||||
dp1++;
|
||||
} else {
|
||||
/* file only in second dir, only diff if -N or -P */
|
||||
if (Nflag || Pflag)
|
||||
diffit(dent2, path1, dirlen1, path2, dirlen2,
|
||||
flags);
|
||||
else
|
||||
else {
|
||||
print_only(path2, dirlen2, dent2->d_name);
|
||||
status = 1;
|
||||
}
|
||||
dp2++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue