summaryrefslogtreecommitdiff
path: root/gnulib
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-10-11 14:35:15 +0200
committerPavel Raiskup <praiskup@redhat.com>2015-10-12 21:26:51 +0200
commit9187e9a231e0a06cc29c336857e95f07f855b2c9 (patch)
tree9c0be768f33b6006a32cb931b536454dafe76e2c /gnulib
parent16dbc070d32e6d4601cb5878dfdf69f2e29c84e1 (diff)
downloadlibtool-9187e9a231e0a06cc29c336857e95f07f855b2c9.tar.gz
funclib: refactor quoting methods a bit
From now we have two basic functions to perform string quoting for shell evaluation -- 'func_quote_arg' to quote one argument and 'func_quote' which takes list of arguments to be quoted. New function name-scheme should be more descriptive (previously we called func_quote_for_eval with one argument and also multiple arguments, while we had confusing $func_quote_for_eval_unquoted_result which is redundant for multiple-arguments call). New abstraction allowed us (in an easy way) to implement bash-specific optimization for quoting (using 'printf -v VARNAME %q "$value"', suggested by Eric Blake), this construct may be used on those places where we don't care much about the result aesthetics (its thus not useful for '*.la' generation or for error printing). * gl/build-aux/funclib.sh (func_append_quoted): Use func_quote_arg internally (kept in 'pretty' mode for now). (func_quote): Made to be "main" high-level quoting method taking list of arguments to be quoted into single command. It replaces func_quote_for_{expand,eval}. (func_quote_portable): Implements quoting in shell, falling back to portable sed call (rare cases). (func_quotefast_eval): New internal function using fast bash-specific construct, falling back to func_quote_portable for non-Bash scripts. (func_quote_arg): New function to quote one argument. (func_quote_for_eval): Removed. All callers changed to call func_quote. (func_quote_for_expand): Likewise. * bootstrap: Sync with funclib.sh and options-parser.
Diffstat (limited to 'gnulib')
0 files changed, 0 insertions, 0 deletions