Skip to content

Fix strip_quotes() to handle empty strings

strip_quotes() assumed its parameter is at least one character long, and errored out on an empty string.

It also converted a string consisting of a single quote to an empty string because that single quote had a quote as first and last char.

This commit fixes these two bugs.

Also rewrite TestStripQuotes to use tests[], and add some test for an empty string, a one-char path (just a slash) and a single quote.

I propose this patch for 2.11..master.

Merge request reports