projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45d1336
)
Coverity fixes
author
Colin Leroy
<colin@colino.net>
Thu, 5 Jun 2014 15:06:36 +0000
(17:06 +0200)
committer
Colin Leroy
<colin@colino.net>
Thu, 5 Jun 2014 15:06:36 +0000
(17:06 +0200)
src/addrharvest.c
patch
|
blob
|
history
diff --git
a/src/addrharvest.c
b/src/addrharvest.c
index 4178f0ef3b4cde5cc5c07bf40849d2824e316d76..d862eca36a98863a3978b527233bf0f7b015b847 100644
(file)
--- a/
src/addrharvest.c
+++ b/
src/addrharvest.c
@@
-776,8
+776,8
@@
static void addrharvest_harvest_dir(
/* Process directory */
r = chdir( dir );
while( r == 0 && ( d = readdir( dp ) ) != NULL ) {
/* Process directory */
r = chdir( dir );
while( r == 0 && ( d = readdir( dp ) ) != NULL ) {
- g_stat( d->d_name, &s );
- if( S_ISDIR( s.st_mode ) ) {
+ g
int sr = g
_stat( d->d_name, &s );
+ if(
sr == 0 &&
S_ISDIR( s.st_mode ) ) {
if( harvester->folderRecurse ) {
if( strstr( DIR_IGNORE, d->d_name ) != NULL )
continue;
if( harvester->folderRecurse ) {
if( strstr( DIR_IGNORE, d->d_name ) != NULL )
continue;
@@
-785,7
+785,7
@@
static void addrharvest_harvest_dir(
harvester, cache, listHdr, d->d_name );
}
}
harvester, cache, listHdr, d->d_name );
}
}
- if( S_ISREG( s.st_mode ) ) {
+ if(
sr == 0 &&
S_ISREG( s.st_mode ) ) {
if( ( num = to_number( d->d_name ) ) >= 0 ) {
addrharvest_readfile(
harvester, d->d_name, cache, listHdr );
if( ( num = to_number( d->d_name ) ) >= 0 ) {
addrharvest_readfile(
harvester, d->d_name, cache, listHdr );
@@
-820,6
+820,7
@@
static void addrharvest_harvest_list(
/* Process message list */
r = chdir( harvester->path );
if (r != 0) {
/* Process message list */
r = chdir( harvester->path );
if (r != 0) {
+ closedir( dp );
g_message("cannot chdir %s\n", harvester->path);
return;
}
g_message("cannot chdir %s\n", harvester->path);
return;
}