Commit 30f6c82
Escape tilde more gracefully
Tilde needs to be escaped only when it's the first character after the white space. Otherwise, we can keep the string unescaped.
This supports bzlmod better, because tilde is used in the directory names.
Users often already escape location function, for example `SJ="$(location @bazel_tools//tools/jdk:singlejar)"; $SJ`. Without the change this becomes `'external/repo~name/singlejar'` and the script fails (no file found).
Location function shouldn't be escaped. But without this change we risk a lot of users will need to fix their scripts.
Closes bazelbuild#16560.
PiperOrigin-RevId: 484226256
Change-Id: I6b71f89a649f8494b76a4446b8f6384421eb89d11 parent 5895fd3 commit 30f6c82
File tree
2 files changed
+14
-3
lines changed- src
- main/java/com/google/devtools/build/lib/util
- test/java/com/google/devtools/build/lib/util
2 files changed
+14
-3
lines changedLines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
0 commit comments