diff --git a/main.cpp b/main.cpp
index 463a00396..e2e056fc0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -35,6 +35,7 @@
#include
#else
#include
+#include
#endif
//---------------------------------------------------------------------------
@@ -92,22 +93,19 @@ static void RecursiveAddFiles( std::vector &filenames, const char p
#else
// gcc / cygwin..
glob_t glob_results;
- #ifdef __GNUC__
- // gcc..
- glob("*", GLOB_ONLYDIR, 0, &glob_results);
- #else
- // cygwin..
- glob("*", 0, 0, &glob_results);
- #endif
+ glob("*", GLOB_MARK, 0, &glob_results);
for ( unsigned int i = 0; i < glob_results.gl_pathc; i++ )
{
const char *dirname = glob_results.gl_pathv[i];
if ( dirname[0] == '.' )
continue;
+ if ( strchr(dirname, '/') == 0 )
+ continue;
+
chdir( dirname );
std::ostringstream curdir;
- curdir << path << dirname << "/";
+ curdir << path << dirname;
RecursiveAddFiles( filenames, curdir.str().c_str() );
chdir( ".." );
}
diff --git a/tokenize.cpp b/tokenize.cpp
index ae360fe88..863e97e25 100644
--- a/tokenize.cpp
+++ b/tokenize.cpp
@@ -683,7 +683,7 @@ void SimplifyTokenList()
free(tok->str);
char str[10];
// 'sizeof(type *)' has the same size as 'sizeof(char *)'
- sprintf( str, "%d", sizeof(char *));
+ sprintf( str, "%lu", sizeof(char *));
tok->str = strdup( str );
for (int i = 0; i < 4; i++)