summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-11-16 21:35:17 (EST)
committer P. J. McDermott <pjm@nac.net>2012-11-16 21:35:17 (EST)
commitca617f3a0b1c5b0516128e143c0352a204ccadea (patch)
tree1b2d4eb823b0224fc91c631f41de916e0eb412e1 /lib
parent1e6530a93ac01d073461bd8512f72a56676ca71d (diff)
ob_set_substvar(): Escape single quotes in value.
Diffstat (limited to 'lib')
-rw-r--r--lib/control.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/control.sh b/lib/control.sh
index 746863e..d480c22 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -177,6 +177,9 @@ ob_set_substvar()
};
')"
+ # Escape single quotes in value.
+ _obssv_value="$(printf '%s\n' "${_obssv_value}" | sed "s/'/'\\\\''/g")"
+
eval "_OB_SUBSTVAR_${_obssv_name}='${_obssv_value}'"
_ob_return 125