Test for bug 1192 - brace expansion.

Commit 968d1c3 (Portability) introduced a bug with some very POSIX
compliant shells (eg dash), which don't do brace expansion.  So add a
test for that.

The test runs by adding a new protocol in Uri, sh+cp://path/.  This
protocol is not intended to be used normally, but is only for testing
the push and pull code.

Signed-off-by: Russell Steicke <russells@adelie.cx>
This commit is contained in:
Russell Steicke
2013-03-31 00:04:28 +08:00
committed by Paul Beckingham
parent 983e07ab01
commit 0cc7bc337d
8 changed files with 213 additions and 0 deletions

View File

@@ -197,6 +197,10 @@ std::string Uri::ToString ()
if (is_local ())
return _data;
// No password to obscure, return the original.
if (_protocol == "sh+cp")
return _data;
std::string result;
result = _protocol + "://";
@@ -256,6 +260,13 @@ void Uri::parse ()
pathDelimiter = ":";
}
if (_protocol == "sh+cp")
{
_path = _data;
_parsed = true;
return;
}
// user delimited by single quotes?
if ( _data[0] == '\''
&& (pos = _data.find("'", 1)) != std::string::npos )