Skip to content

Commit f25846d

Browse files
olcbeanjasontedor
authored andcommitted
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
1 parent 08a0d4d commit f25846d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

distribution/src/main/resources/bin/elasticsearch-service.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ for %%a in ("%ES_JAVA_OPTS:;=","%") do (
234234
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%
235235

236236
if "%JVM_MS%" == "" (
237-
echo minimum heap size not set; configure using -Xms via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
237+
echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
238238
goto:eof
239239
)
240240
if "%JVM_MX%" == "" (
241-
echo maximum heap size not set; configure using -Xmx via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
241+
echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
242242
goto:eof
243243
)
244244
if "%JVM_SS%" == "" (
245-
echo thread stack size not set; configure using -Xss via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
245+
echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
246246
goto:eof
247247
)
248248

0 commit comments

Comments
 (0)