Skip to content

Ghidra is a software reverse engineering (SRE) framework

Fix help builds failing when a path contains a module name

sathish123medcc76a8d031
diff --git a/gradle/helpProject.gradle b/gradle/helpProject.gradle
index 9ad85ce313..22f672b592 100644
--- a/gradle/helpProject.gradle
+++ b/gradle/helpProject.gradle
@@ -138,7 +138,9 @@ def getModulePathFromJar(File file) {
}
def moduleName = matcher.group(1);
- def index = forwardSlashedPath.indexOf(moduleName) + moduleName.length()
+ // Use the match position, as the module name may also appear earlier in the path
+ // (e.g., in a parent workspace directory name)
+ def index = matcher.start(1) + moduleName.length()
return forwardSlashedPath.substring(0, index)
}