From 4fed79c2d8fb129acdfa6ea477d6cfd8001ceb03 Mon Sep 17 00:00:00 2001 From: Rob1103 Date: Sat, 12 Nov 2022 17:53:40 +0100 Subject: [PATCH] progamPath bug fix --- srcs/dependtool/static_analyser.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/srcs/dependtool/static_analyser.go b/srcs/dependtool/static_analyser.go index 8955cd4..d465e7c 100644 --- a/srcs/dependtool/static_analyser.go +++ b/srcs/dependtool/static_analyser.go @@ -275,7 +275,13 @@ func extractPrototype(sourcesFiltered []string, data *u.Data) error { func gatherSourceFileSymbols(data *u.Data, programPath string) error { tmp := strings.Split(programPath, "/") - folderPath := strings.Join(tmp[:len(tmp)-1], "/") + i := 2 + for ; i < len(tmp); i++ { + if tmp[len(tmp)-i] == "apps" { + break + } + } + folderPath := strings.Join(tmp[:len(tmp)-i+2], "/") files, err := findSourcesFiles(folderPath) if err != nil {