mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix macro replacements: skip relative paths to root to not walk relatively under root dir
This commit is contained in:
+1
-2
@@ -86,12 +86,11 @@ public class ModulePathMacroManager extends BasePathMacroManager /*ProjectPathMa
|
||||
|
||||
String macro = "$" + PathMacrosImpl.MODULE_DIR_MACRO_NAME + "$";
|
||||
boolean check = false;
|
||||
while (f != null) {
|
||||
while (f != null && f.getParentFile() != null) {
|
||||
@NonNls String path = PathMacroMap.quotePath(f.getAbsolutePath());
|
||||
String s = macro;
|
||||
|
||||
if (StringUtil.endsWithChar(path, '/')) s += "/";
|
||||
if (path.equals("/")) break;
|
||||
|
||||
putIfAbsent(result, "file://" + path, "file://" + s, check);
|
||||
putIfAbsent(result, "file:/" + path, "file:/" + s, check);
|
||||
|
||||
+1
-2
@@ -57,12 +57,11 @@ public class ProjectPathMacroManager extends BasePathMacroManager {
|
||||
|
||||
String macro = "$" + PathMacrosImpl.PROJECT_DIR_MACRO_NAME + "$";
|
||||
boolean check = false;
|
||||
while (f != null) {
|
||||
while (f != null && f.getParentFile() != null) {
|
||||
String path = PathMacroMap.quotePath(f.getAbsolutePath());
|
||||
String s = macro;
|
||||
|
||||
if (StringUtil.endsWithChar(path, '/')) s += "/";
|
||||
if (path.equals("/")) break;
|
||||
|
||||
putIfAbsent(result, "file://" + path, "file://" + s, check);
|
||||
putIfAbsent(result, "file:/" + path, "file:/" + s, check);
|
||||
|
||||
Reference in New Issue
Block a user