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:49:26 UTC

[lucene-solr] branch branch_8x 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_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


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

commit 25ec0ddb73a697fcc1e069e8a62b75472b6c702d
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 {