From 20e764c614aaee654bbe492378018aae9327c9f5 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 2 Aug 2010 14:48:35 -0700 Subject: eval "allowed:" script in template * this emulates the original behavior that "allowed:" script is "eval"ed rather than "exec"ed. --- src/cstore/cstore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp index 28c9d63..e5de5b4 100644 --- a/src/cstore/cstore.cpp +++ b/src/cstore/cstore.cpp @@ -626,7 +626,11 @@ Cstore::getCompletionEnv(const vector& comps, string& env) if (def.def_enumeration) { cmd_str += (C_ENUM_SCRIPT_DIR + "/" + def.def_enumeration); } else { - cmd_str += def.def_allowed; + string astr = def.def_allowed; + shell_escape_squotes(astr); + cmd_str += "_cstore_internal_allowed () { eval '"; + cmd_str += astr; + cmd_str += "'; }; _cstore_internal_allowed"; } char *buf = (char *) malloc(MAX_CMD_OUTPUT_SIZE); -- cgit v1.2.3