Commit fbdb26b
committed
[gh-11485] Replace xargs -0 with POSIX-compliant alternative
The xargs -0 option is not POSIX-compliant and is not available on AIX,
FreeBSD, and other systems. This commit replaces the use of xargs -0 in
the concat_lines function with a pure shell solution that reads
NUL-terminated strings using the read builtin with -d '' option.
The new implementation:
- Maintains the same functionality of handling special characters like
pipes, quotes, and spaces correctly
- Avoids the non-portable xargs -0 option
- Uses a while loop with read -r -d '' to process NUL-terminated strings
- Builds the result string incrementally instead of using tr to convert
newlines to spaces
This fix ensures that the mvn script works correctly on all POSIX-compliant
systems while preserving the behavior introduced in commit aeff353
to handle quoted pipes and other special characters in .mvn/jvm.config.
Fixes #114851 parent 77f52a4 commit fbdb26b
1 file changed
+33
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
188 | 204 | | |
189 | 205 | | |
190 | 206 | | |
| |||
0 commit comments