From owner-p4-projects@FreeBSD.ORG Sat Jul 26 15:16:52 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 136821065675; Sat, 26 Jul 2008 15:16:52 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB9C1106566C for ; Sat, 26 Jul 2008 15:16:51 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BB24D8FC17 for ; Sat, 26 Jul 2008 15:16:51 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m6QFGpTH004957 for ; Sat, 26 Jul 2008 15:16:51 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6QFGpo2004955 for perforce@freebsd.org; Sat, 26 Jul 2008 15:16:51 GMT (envelope-from gabor@freebsd.org) Date: Sat, 26 Jul 2008 15:16:51 GMT Message-Id: <200807261516.m6QFGpo2004955@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 145977 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jul 2008 15:16:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=145977 Change 145977 by gabor@gabor_server on 2008/07/26 15:16:30 - Fix --ignore-file-name-case Affected files ... .. //depot/projects/soc2008/gabor_textproc/diff/diffdir.c#5 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/diff/diffdir.c#5 (text+ko) ==== @@ -47,7 +47,7 @@ static int dircompare(const void *, const void *); static int excluded(const char *); static struct dirent **slurpdir(char *, char **, int); -static void diffit(struct dirent *, char *, size_t, char *, size_t); +static void diffit(struct dirent *, struct dirent *, char *, size_t, char *, size_t); #define d_status d_type /* we need to store status for -l */ @@ -116,13 +116,13 @@ strcasecmp(dent1->d_name, dent2->d_name); if (pos == 0) { /* file exists in both dirs, diff it */ - diffit(dent1, path1, dirlen1, path2, dirlen2); + diffit(dent1, dent2, path1, dirlen1, path2, dirlen2); dp1++; dp2++; } else if (pos < 0) { /* file only in first dir, only diff if -N */ if (Nflag) - diffit(dent1, path1, dirlen1, path2, dirlen2); + diffit(dent1, dent2, path1, dirlen1, path2, dirlen2); else if (lflag) dent1->d_status |= D_ONLY; else @@ -131,7 +131,7 @@ } else { /* file only in second dir, only diff if -N or -P */ if (Nflag || Pflag) - diffit(dent2, path1, dirlen1, path2, dirlen2); + diffit(dent2, dent1, path1, dirlen1, path2, dirlen2); else if (lflag) dent2->d_status |= D_ONLY; else @@ -268,11 +268,11 @@ * Do the actual diff by calling either diffreg() or diffdir(). */ static void -diffit(struct dirent *dp, char *path1, size_t plen1, char *path2, size_t plen2) +diffit(struct dirent *dp1, struct dirent *dp2,char *path1, size_t plen1, char *path2, size_t plen2) { int flags = D_HEADER; - strlcpy(path1 + plen1, dp->d_name, MAXPATHLEN - plen1); + strlcpy(path1 + plen1, dp1->d_name, MAXPATHLEN - plen1); if (stat(path1, &stb1) != 0) { if (!(Nflag || Pflag) || errno != ENOENT) { warn("%s", path1); @@ -282,7 +282,7 @@ memset(&stb1, 0, sizeof(stb1)); } - strlcpy(path2 + plen2, dp->d_name, MAXPATHLEN - plen2); + strlcpy(path2 + plen2, dp2->d_name, MAXPATHLEN - plen2); if (stat(path2, &stb2) != 0) { if (!Nflag || errno != ENOENT) { warn("%s", path2); @@ -299,20 +299,20 @@ if (rflag) diffdir(path1, path2); else if (lflag) - dp->d_status |= D_COMMON; + dp1->d_status |= D_COMMON; else printf("Common subdirectories: %s and %s\n", path1, path2); return; } if (!S_ISREG(stb1.st_mode) && !S_ISDIR(stb1.st_mode)) - dp->d_status = D_SKIPPED1; + dp1->d_status = D_SKIPPED1; else if (!S_ISREG(stb2.st_mode) && !S_ISDIR(stb2.st_mode)) - dp->d_status = D_SKIPPED2; + dp1->d_status = D_SKIPPED2; else - dp->d_status = diffreg(path1, path2, flags); + dp1->d_status = diffreg(path1, path2, flags); if (!lflag) - print_status(dp->d_status, path1, path2, NULL); + print_status(dp1->d_status, path1, path2, NULL); } /*