When scanning a directory, if the call to stat
fails, the error message prints the directory name but not the file that caused the error, which makes the symptom hard to debug.
A simple patch:
--- a/src/astyle_main.cpp
+++ b/src/astyle_main.cpp
@@ -1306,7 +1306,7 @@ void ASConsole::getFileNames(const string& directory, const vector<string>& wild
continue;
}
perror("errno message");
- error("Error getting file status in directory", directory.c_str());
+ error("Error getting file status for", entryFilepath.c_str());
}
// skip hidden or read only
if (entry->d_name[0] == '.' || !(statbuf.st_mode & S_IWUSR))
applied in version 3.2.1