summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/ignore.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-12-11 12:24:21 +0000
committerpeter <peter@FreeBSD.org>1999-12-11 12:24:21 +0000
commit784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (patch)
tree2a59869a343a5d43c01370f1083d67c2a02785a0 /contrib/cvs/src/ignore.c
parent308b60f66831aa65a459a7b347ea6ca14b6e4799 (diff)
downloadFreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.zip
FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.tar.gz
Import cvs-1.10.7. There are a number of nasty bugs that have been fixed.
Obtained from: cyclic.com
Diffstat (limited to 'contrib/cvs/src/ignore.c')
-rw-r--r--contrib/cvs/src/ignore.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index 5d7ca61..df08017 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -82,6 +82,11 @@ ign_setup ()
/* Then add entries found in home dir, (if user has one) and file exists */
home_dir = get_homedir ();
+ /* If we can't find a home directory, ignore ~/.cvsignore. This may
+ make tracking down problems a bit of a pain, but on the other
+ hand it might be obnoxious to complain when CVS will function
+ just fine without .cvsignore (and many users won't even know what
+ .cvsignore is). */
if (home_dir)
{
char *file = xmalloc (strlen (home_dir) + sizeof (CVSDOTIGNORE) + 10);
@@ -176,7 +181,7 @@ ign_add (ign, hold)
char save;
/* ignore whitespace before the token */
- if (isspace (*ign))
+ if (isspace ((unsigned char) *ign))
continue;
/*
@@ -184,7 +189,8 @@ ign_add (ign, hold)
* (saving it if necessary). We also catch * as a special case in a
* global ignore file as an optimization
*/
- if ((!*(ign+1) || isspace (*(ign+1))) && (*ign == '!' || *ign == '*'))
+ if ((!*(ign+1) || isspace ((unsigned char) *(ign+1)))
+ && (*ign == '!' || *ign == '*'))
{
if (!hold)
{
@@ -233,7 +239,7 @@ ign_add (ign, hold)
}
/* find the end of this token */
- for (mark = ign; *mark && !isspace (*mark); mark++)
+ for (mark = ign; *mark && !isspace ((unsigned char) *mark); mark++)
/* do nothing */ ;
save = *mark;
@@ -395,11 +401,15 @@ ignore_files (ilist, entries, update_dir, proc)
dirp = CVS_OPENDIR (".");
if (dirp == NULL)
+ {
+ error (0, errno, "cannot open current directory");
return;
+ }
ign_add_file (CVSDOTIGNORE, 1);
wrap_add_file (CVSDOTWRAPPER, 1);
+ errno = 0;
while ((dp = readdir (dirp)) != NULL)
{
file = dp->d_name;
@@ -476,6 +486,9 @@ ignore_files (ilist, entries, update_dir, proc)
}
(*proc) (file, xdir);
+ errno = 0;
}
+ if (errno != 0)
+ error (0, errno, "error reading current directory");
(void) closedir (dirp);
}
OpenPOWER on IntegriCloud