mirror of
https://git.ludikovsky.name/git/fugitive.git
synced 2024-10-05 15:35:29 +02:00
fix replace_str '&' bug
'&' is a special char for sed and needed to be escaped (it caused bug for instance when the title of an article contained xml entities like ")
This commit is contained in:
parent
80c2dcf4a9
commit
0bc46006e9
|
@ -118,7 +118,7 @@ replace_condition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_str() {
|
replace_str() {
|
||||||
esc=`echo $2 | sed 's/\//\\\\\//g'`
|
esc=`echo "$2" | sed 's/\//\\\\\//g;s/&/\\\&/g'`
|
||||||
replace_condition "$1" "$2" | \
|
replace_condition "$1" "$2" | \
|
||||||
sed "s/<?fugitive[[:space:]]\+$1[[:space:]]*?>/$esc/g"
|
sed "s/<?fugitive[[:space:]]\+$1[[:space:]]*?>/$esc/g"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue