When command lines are constructed, filenames are often quoted by simply adding double quotes. This won't work if the filename contains certain shell metacharacters, including $, ` (backtick) or " (double quote).
The attached patch adds and uses a quote() function, which quotes a filename (or any other string) by enclosing it in single quotes and replacing any embedded single quotes with the string '\'' (single-quote, backslash, single-quote, single-quote).
This should ensure that, after the shell has performed its substitutions, you end up with the original string.
Log in to post a comment.