Skip to content

Commit c03f0c8

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 elastic#26916
1 parent e22844b commit c03f0c8

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
@@ -163,15 +163,15 @@ for %%a in ("%ES_JAVA_OPTS:;=","%") do (
163163
@endlocal & set JVM_MS=%JVM_MS% & set JVM_MX=%JVM_MX% & set JVM_SS=%JVM_SS%
164164

165165
if "%JVM_MS%" == "" (
166-
echo minimum heap size not set; configure using -Xms via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
166+
echo minimum heap size not set; configure using -Xms via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
167167
goto:eof
168168
)
169169
if "%JVM_MX%" == "" (
170-
echo maximum heap size not set; configure using -Xmx via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
170+
echo maximum heap size not set; configure using -Xmx via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
171171
goto:eof
172172
)
173173
if "%JVM_SS%" == "" (
174-
echo thread stack size not set; configure using -Xss via %ES_JVM_OPTIONS% or ES_JAVA_OPTS
174+
echo thread stack size not set; configure using -Xss via "%ES_JVM_OPTIONS%" or ES_JAVA_OPTS
175175
goto:eof
176176
)
177177

0 commit comments

Comments
 (0)