From d77956f63fa8945d7b8ca666c88e567c6e49b93f Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Sun, 7 Dec 2008 00:56:24 +0000 Subject: [PATCH] Fix bug when calling cppcheck without --recursive flag --- FileLister.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FileLister.cpp b/FileLister.cpp index dc93b188d..3f9455c9d 100644 --- a/FileLister.cpp +++ b/FileLister.cpp @@ -156,12 +156,16 @@ void FileLister::RecursiveAddFiles( std::vector &filenames, const s void FileLister::RecursiveAddFiles( std::vector &filenames, const std::string &path, bool recursive ) { - std::ostringstream oss; + std::ostringstream bdir, oss; oss << path; if (recursive) { + bdir << path; if ( path.length() > 0 && path[path.length()-1] != '/' ) + { + bdir << "/"; oss << "/"; + } oss << "*"; } @@ -174,7 +178,7 @@ void FileLister::RecursiveAddFiles( std::vector &filenames, const s do { std::ostringstream fname; - fname << path << ffd.cFileName; + fname << bdir.str().c_str() << ffd.cFileName; if ( ffd.cFileName[0] == '.' || ffd.cFileName[0] == '\0' ) continue;