From c03f0c89af952b7a013829d3643fc7ef6afb4b4c Mon Sep 17 00:00:00 2001 From: olcbean Date: Tue, 10 Oct 2017 14:56:08 +0200 Subject: [PATCH] Fix handling of paths containing parentheses This commit fixes an issue with the handling of paths containing parentheses on Windows. When such a path is used as a component of Elasticsearch home, then a later echo statement that is guarded by an if will fail because the parentheses in the path will be confused with the parentheses defining the if block. This commit fixes the issue by protecting this echo statement by wrapping the possibly offending path in quotes. Relates #26916 --- .../src/main/resources/bin/elasticsearch-service.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distribution/src/main/resources/bin/elasticsearch-service.bat b/distribution/src/main/resources/bin/elasticsearch-service.bat index 8326c689b2877..dfb854a47087e 100644 --- a/distribution/src/main/resources/bin/elasticsearch-service.bat +++ b/distribution/src/main/resources/bin/elasticsearch-service.bat @@ -163,15 +163,15 @@ for %%a in ("%ES_JAVA_OPTS:;=","%") do ( @endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS% if "%JVM_MS%" == "" ( - echo minimum heap size not set; configure using -Xms via %ES_JVM_OPTIONS% or ES_JAVA_OPTS + echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS goto:eof ) if "%JVM_MX%" == "" ( - echo maximum heap size not set; configure using -Xmx via %ES_JVM_OPTIONS% or ES_JAVA_OPTS + echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS goto:eof ) if "%JVM_SS%" == "" ( - echo thread stack size not set; configure using -Xss via %ES_JVM_OPTIONS% or ES_JAVA_OPTS + echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS goto:eof )