Skip to content

Commit bd3709d

Browse files
author
Vladimir Kotal
committed
project path needs to use /
fixes #2551
1 parent 767f9f7 commit bd3709d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/Project.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class Project implements Comparable<Project>, Nameable, Serializable {
5050
ClassUtil.remarkTransientFields(Project.class);
5151
}
5252

53+
/**
54+
* Path relative to source root. Uses the '/' separator on all platforms.
55+
*/
5356
private String path;
5457

5558
/**
@@ -175,15 +178,13 @@ public void setName(String name) {
175178
}
176179

177180
/**
178-
* Set the path (relative from source root) this project is located It seems
179-
* that you should ALWAYS prefix the path with current file.separator ,
180-
* current environment should always have it set up
181+
* Set the path (relative from source root) this project is located.
181182
*
182183
* @param path the relative path from source root where this project is
183-
* located.
184+
* located, starting with path separator.
184185
*/
185186
public void setPath(String path) {
186-
this.path = path;
187+
this.path = Util.fixPathIfWindows(path);
187188
}
188189

189190
public void setIndexed(boolean flag) {

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ public void prepareIndexer(RuntimeEnvironment env,
940940
// Add a project for each top-level directory in source root.
941941
for (File file : files) {
942942
String name = file.getName();
943-
String path = File.separator + name;
943+
String path = '/' + name;
944944
if (oldProjects.containsKey(name)) {
945945
// This is an existing object. Reuse the old project,
946946
// possibly with customizations, instead of creating a

0 commit comments

Comments
 (0)