[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog find_names.c ignore.c import.c
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog find_names.c ignore.c import.c |
Date: |
Wed, 29 Aug 2007 00:27:45 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Changes by: Derek Robert Price <dprice> 07/08/29 00:27:45
Modified files:
src : ChangeLog find_names.c ignore.c import.c
Log message:
* find_names.c, ignore.c, import.c [DT_DIR]: Remove blocks, simplyfing
with replacements using new DIRENT_* macros from lib/system.h.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3528&r2=1.3529
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/find_names.c?cvsroot=cvs&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ignore.c?cvsroot=cvs&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/import.c?cvsroot=cvs&r1=1.184&r2=1.185
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3528
retrieving revision 1.3529
diff -u -b -r1.3528 -r1.3529
--- ChangeLog 28 Aug 2007 17:33:13 -0000 1.3528
+++ ChangeLog 29 Aug 2007 00:27:44 -0000 1.3529
@@ -1,5 +1,8 @@
2007-08-28 Derek Price <address@hidden>
+ * find_names.c, ignore.c, import.c [DT_DIR]: Remove blocks, simplyfing
+ with replacements using new DIRENT_* macros from lib/system.h.
+
* logmsg.c (do_editor): Improve header block comment. Honor new
FirstVerifyLogErrorFatal option.
* parseinfo.c (new_config): Initialize new FirstVerifyLogErrorFatal
Index: find_names.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/find_names.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- find_names.c 30 May 2007 23:20:43 -0000 1.45
+++ find_names.c 29 Aug 2007 00:27:45 -0000 1.46
@@ -472,45 +472,30 @@
&& strcmp (dp->d_name, CVSNULLREPOS) == 0)
goto do_it_again;
-#ifdef DT_DIR
- if (dp->d_type != DT_DIR)
- {
- if (dp->d_type != DT_UNKNOWN && dp->d_type != DT_LNK)
+ if (!DIRENT_MIGHT_BE_DIR(dp))
goto do_it_again;
-#endif
+
/* don't bother stating ,v files */
if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
goto do_it_again;
+ if (!DIRENT_MUST_BE(dp, DT_DIR))
+ {
expand_string (&tmp,
&tmp_size,
strlen (dir) + strlen (dp->d_name) + 10);
sprintf (tmp, "%s/%s", dir, dp->d_name);
if (!isdir (tmp))
goto do_it_again;
-
-#ifdef DT_DIR
}
-#endif
/* check for administration directories (if needed) */
if (checkadm)
{
/* blow off symbolic links to dirs in local dir */
-#ifdef DT_DIR
- if (dp->d_type != DT_DIR)
- {
- /* we're either unknown or a symlink at this point */
- if (dp->d_type == DT_LNK)
- goto do_it_again;
-#endif
- /* Note that we only get here if we already set tmp
- above. */
- if (islink (tmp))
+ if (DIRENT_MUST_BE(dp, DT_LNK)
+ || DIRENT_MIGHT_BE_SYMLINK(dp) && islink(tmp))
goto do_it_again;
-#ifdef DT_DIR
- }
-#endif
/* check for new style */
expand_string (&tmp,
Index: ignore.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ignore.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- ignore.c 27 Aug 2007 02:11:05 -0000 1.58
+++ ignore.c 29 Aug 2007 00:27:45 -0000 1.59
@@ -445,21 +445,15 @@
if (ign_name (file))
continue;
- if (
-#ifdef DT_DIR
- dp->d_type != DT_UNKNOWN ||
-#endif
- lstat (file, &sb) != -1)
+ if (!DIRENT_MUST_BE(dp, DT_UNKNOWN)
+ || lstat (file, &sb) != -1)
{
-
- if (
-#ifdef DT_DIR
- dp->d_type == DT_DIR
- || (dp->d_type == DT_UNKNOWN && S_ISDIR (sb.st_mode))
-#else
- S_ISDIR (sb.st_mode)
-#endif
- )
+ if (DIRENT_MUST_BE(dp, DT_LNK)
+ || DIRENT_MIGHT_BE_SYMLINK(dp) && S_ISLNK(sb.st_mode))
+ /* Skip symlinks. */
+ continue;
+ else if (DIRENT_MUST_BE(dp, DT_DIR)
+ || DIRENT_MIGHT_BE_DIR(dp) && S_ISDIR (sb.st_mode))
{
if (!subdirs)
{
@@ -472,19 +466,6 @@
free (temp);
}
}
-#ifdef S_ISLNK
- else if (
-#ifdef DT_DIR
- dp->d_type == DT_LNK
- || (dp->d_type == DT_UNKNOWN && S_ISLNK (sb.st_mode))
-#else
- S_ISLNK (sb.st_mode)
-#endif
- )
- {
- continue;
- }
-#endif
}
p = getnode ();
Index: import.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/import.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -b -r1.184 -r1.185
--- import.c 28 Aug 2007 00:15:09 -0000 1.184
+++ import.c 29 Aug 2007 00:27:45 -0000 1.185
@@ -512,15 +512,14 @@
goto one_more_time_boys;
}
- if (
-#ifdef DT_DIR
- (dp->d_type == DT_DIR
- || (dp->d_type == DT_UNKNOWN && isdir (dp->d_name)))
-#else
- isdir (dp->d_name)
-#endif
- && !wrap_name_has (dp->d_name, WRAP_TOCVS)
- )
+ if (DIRENT_MUST_BE(dp, DT_LNK)
+ || DIRENT_MIGHT_BE_SYMLINK(dp) && islink (dp->d_name))
+ {
+ add_log ('L', dp->d_name);
+ err++;
+ }
+ else if (DIRENT_MUST_BE(dp, DT_DIR)
+ || DIRENT_MIGHT_BE_DIR(dp) && isdir (dp->d_name))
{
Node *n;
@@ -531,18 +530,6 @@
n->key = xstrdup (dp->d_name);
addnode (dirlist, n);
}
- else if (
-#ifdef DT_DIR
- dp->d_type == DT_LNK
- || (dp->d_type == DT_UNKNOWN && islink (dp->d_name))
-#else
- islink (dp->d_name)
-#endif
- )
- {
- add_log ('L', dp->d_name);
- err++;
- }
else
{
#ifdef CLIENT_SUPPORT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog find_names.c ignore.c import.c,
Derek Robert Price <=