projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78a843e
)
Fix globbing failure when stat call fails
author
Andrey Kamaev
<andrey.kamaev@itseez.com>
Mon, 25 Mar 2013 13:38:50 +0000
(17:38 +0400)
committer
Andrey Kamaev
<andrey.kamaev@itseez.com>
Mon, 25 Mar 2013 13:38:50 +0000
(17:38 +0400)
modules/core/src/glob.cpp
patch
|
blob
|
history
diff --git
a/modules/core/src/glob.cpp
b/modules/core/src/glob.cpp
index
d31dcca
..
c655aa9
100644
(file)
--- a/
modules/core/src/glob.cpp
+++ b/
modules/core/src/glob.cpp
@@
-111,11
+111,11
@@
static bool isDir(const cv::String& path, DIR* dir)
return (attributes != INVALID_FILE_ATTRIBUTES) && ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0);
#else
+ (void)dir;
struct stat stat_buf;
- stat( path.c_str(), &stat_buf);
+ if (0 != stat( path.c_str(), &stat_buf))
+ return false;
int is_dir = S_ISDIR( stat_buf.st_mode);
- (void)dir;
-
return is_dir != 0;
#endif
}