From 45b26e322f1e173c8a19f07700e64daa5475da84 Mon Sep 17 00:00:00 2001 From: Ishan Chattopadhyaya Date: Sat, 27 May 2017 03:30:27 +0530 Subject: [PATCH] SOLR-10735: Fixing windows space directory issue --- solr/CHANGES.txt | 3 +++ solr/core/src/java/org/apache/solr/util/SolrCLI.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index cd383d10bf3..7d15bef5163 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -477,6 +477,9 @@ Bug Fixes "lucene"/standard query parser, should require " TO " in range queries, and accept "TO" as endpoints in range queries. (hossman, Steve Rowe) +* SOLR-10735: Windows script (solr.cmd) didn't work properly with directory containing spaces. Adding quotations + to fix (Uwe Schindler, janhoy, Tomas Fernandez-Lobbe, Ishan Chattopadhyaya) + Other Changes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java index 97fdf1ea44e..51ab5d7f5dd 100644 --- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java +++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java @@ -2941,7 +2941,7 @@ public class SolrCLI { solrHome = solrHome.substring(cwdPath.length()+1); String startCmd = - String.format(Locale.ROOT, "%s start %s -p %d -s \"%s\" %s %s %s %s %s %s", + String.format(Locale.ROOT, "\"%s\" start %s -p %d -s \"%s\" %s %s %s %s %s %s", callScript, cloudModeArg, port, solrHome, hostArg, zkHostArg, memArg, forceArg, extraArgs, addlOptsArg); startCmd = startCmd.replaceAll("\\s+", " ").trim(); // for pretty printing