1
0
Fork 0
mirror of https://git.ludikovsky.name/git/fugitive.git synced 2024-05-18 14:35:32 +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:
p4bl0 2010-12-24 13:48:04 +01:00
parent 80c2dcf4a9
commit 0bc46006e9

View file

@ -118,7 +118,7 @@ replace_condition() {
}
replace_str() {
esc=`echo $2 | sed 's/\//\\\\\//g'`
esc=`echo "$2" | sed 's/\//\\\\\//g;s/&/\\\&/g'`
replace_condition "$1" "$2" | \
sed "s/<?fugitive[[:space:]]\+$1[[:space:]]*?>/$esc/g"
}