=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/diff/diffdir.c,v retrieving revision 1.45 retrieving revision 1.46 diff -c -r1.45 -r1.46 *** src/usr.bin/diff/diffdir.c 2015/10/05 20:15:00 1.45 --- src/usr.bin/diff/diffdir.c 2017/08/28 15:33:27 1.46 *************** *** 1,4 **** ! /* $OpenBSD: diffdir.c,v 1.45 2015/10/05 20:15:00 millert Exp $ */ /* * Copyright (c) 2003, 2010 Todd C. Miller --- 1,4 ---- ! /* $OpenBSD: diffdir.c,v 1.46 2017/08/28 15:33:27 millert Exp $ */ /* * Copyright (c) 2003, 2010 Todd C. Miller *************** *** 57,63 **** dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1)); if (dirlen1 >= sizeof(path1) - 1) { warnc(ENAMETOOLONG, "%s", p1); ! status = 2; return; } if (path1[dirlen1 - 1] != '/') { --- 57,63 ---- dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1)); if (dirlen1 >= sizeof(path1) - 1) { warnc(ENAMETOOLONG, "%s", p1); ! status |= 2; return; } if (path1[dirlen1 - 1] != '/') { *************** *** 67,73 **** dirlen2 = strlcpy(path2, *p2 ? p2 : ".", sizeof(path2)); if (dirlen2 >= sizeof(path2) - 1) { warnc(ENAMETOOLONG, "%s", p2); ! status = 2; return; } if (path2[dirlen2 - 1] != '/') { --- 67,73 ---- dirlen2 = strlcpy(path2, *p2 ? p2 : ".", sizeof(path2)); if (dirlen2 >= sizeof(path2) - 1) { warnc(ENAMETOOLONG, "%s", p2); ! status |= 2; return; } if (path2[dirlen2 - 1] != '/') { *************** *** 129,147 **** dp2++; } else if (pos < 0) { /* file only in first dir, only diff if -N */ ! if (Nflag) diffit(dent1, path1, dirlen1, path2, dirlen2, flags); ! else print_only(path1, dirlen1, dent1->d_name); dp1++; } else { /* file only in second dir, only diff if -N or -P */ ! if (Nflag || Pflag) diffit(dent2, path1, dirlen1, path2, dirlen2, flags); ! else print_only(path2, dirlen2, dent2->d_name); dp2++; } } --- 129,151 ---- dp2++; } else if (pos < 0) { /* file only in first dir, only diff if -N */ ! if (Nflag) { diffit(dent1, path1, dirlen1, path2, dirlen2, flags); ! } 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 { print_only(path2, dirlen2, dent2->d_name); + status |= 1; + } dp2++; } }