Merge pull request #118 from GoASTScanner/issue/117

Fix recursive case on Windows platforms
This commit is contained in:
Grant Murphy 2017-01-27 09:22:21 -08:00 committed by GitHub
commit 1c8e7ff686

View file

@ -231,14 +231,14 @@ func main() {
func getFilesToAnalyze(paths []string, excluded *fileList) []string {
//log.Println("getFilesToAnalyze: start")
var toAnalyze []string
for _, path := range paths {
for _, relativePath := range paths {
//log.Printf("getFilesToAnalyze: processing \"%s\"\n", path)
// get the absolute path before doing anything else
path, err := filepath.Abs(path)
path, err := filepath.Abs(relativePath)
if err != nil {
log.Fatal(err)
}
if filepath.Base(path) == "..." {
if filepath.Base(relativePath) == "..." {
toAnalyze = append(
toAnalyze,
listFiles(filepath.Dir(path), recurse, excluded)...,