Commit dfb8bf1
update-source-version: escape special characters when replacing url
URLs can contain characters that sed would consider special in the context of the regex pattern.
Let’s switch the URL replacement `sed` command to use POSIX Basic Regular Expression syntax to reduce the number of characters that need to be escaped:
https://www.gnu.org/software/sed/manual/html_node/BRE-syntax.html
Then, let’s escape all BRE special characters, plus the separator character `|` of the `s` command in the old URL pattern.
Similarly, the replacement part of the `s` command (new URL) can also contain special characters (e.g. the `&` character would be replaced with the whole matched expression), so we need to escape it as well:
https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html
Co-Authored-By: Jan Tojnar <[email protected]>1 parent 49b6072 commit dfb8bf1
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | | - | |
| 236 | + | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
0 commit comments