Commit 8989c91
committed
fix(java_opts): use string-split to restore JAVA_OPTS placeholder
bash 4.x and 5.x treat backslash in ${//} replacement strings differently:
bash 5.x collapses '\\' to '\', bash 4.x leaves it as '\\'. A JAVA_OPTS
value containing a single backslash (e.g. -Dpattern=foo\|bar) was therefore
doubled on CI workers running bash 4.x, causing the unit test
'preserves backslashes in JAVA_OPTS values' to fail remotely while
passing locally on bash 5.x.
Replace the pre-escaped ${//} substitution with string-split using
${%%} and ${#} — pure string operations that never interpret backslash
or '&', identical across bash 3/4/5.1 parent 7dc3b71 commit 8989c91
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
150 | | - | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
199 | 207 | | |
200 | 208 | | |
201 | 209 | | |
| |||
0 commit comments