You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2019/10/11 00:50:16 UTC

[lucene-solr] branch branch_8_3 updated: SOLR-13821: Incorrect file path escape in windows

This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch branch_8_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_3 by this push:
     new 3ce0fc3  SOLR-13821: Incorrect file path escape in windows
3ce0fc3 is described below

commit 3ce0fc38bb7e34aa57e40216f9e6f3f9528e0ccc
Author: noble <no...@apache.org>
AuthorDate: Fri Oct 11 11:47:39 2019 +1100

    SOLR-13821: Incorrect file path escape in windows
---
 solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
index 910f29b..4e86926 100644
--- a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
+++ b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java
@@ -89,13 +89,13 @@ public class DistribPackageStore implements PackageStore {
   @Override
   public Path getRealpath(String path) {
     if (File.separatorChar == '\\') {
-      path = path.replaceAll("/", File.separator);
+      path = path.replace('/' ,  File.separatorChar);
     }
     if (path.charAt(0) != File.separatorChar) {
       path = File.separator + path;
     }
     return new File(this.coreContainer.getResourceLoader().getInstancePath() +
-        "/" + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath();
+        File.separator + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath();
   }
 
   class FileInfo {