uri: Fix indention

This commit is contained in:
Sebastian Dröge 2015-01-22 23:10:06 +02:00
parent d20fa132c1
commit 40a0275298
2 changed files with 18 additions and 16 deletions

View file

@ -1530,7 +1530,8 @@ gst_uri_from_string (const gchar * uri)
int i = 0;
/* be helpful and skip initial white space */
while (*uri == '\v' || g_ascii_isspace (*uri)) uri++;
while (*uri == '\v' || g_ascii_isspace (*uri))
uri++;
if (g_ascii_isalpha (uri[i])) {
/* find end of scheme name */
@ -1562,8 +1563,8 @@ gst_uri_from_string (const gchar * uri)
eoh = strchr (uri, ']');
if (eoh == NULL || eoh > eoa) {
GST_DEBUG ("Unable to parse the host part of the URI '%s'.",
orig_uri);
_gst_uri_free (uri_obj);
orig_uri);
_gst_uri_free (uri_obj);
return NULL;
}
reoh = eoh + 1;
@ -1582,7 +1583,7 @@ gst_uri_from_string (const gchar * uri)
/* if port number is malformed then we can't parse this */
if (uri[0] != ':' || strspn (uri + 1, "0123456789") != eoa - uri - 1) {
GST_DEBUG ("Unable to parse host/port part of the URI '%s'.",
orig_uri);
orig_uri);
_gst_uri_free (uri_obj);
return NULL;
}

View file

@ -371,15 +371,16 @@ GST_END_TEST;
static const struct URITest url_presenting_tests[] = {
/* check all URI elements present */
{ .uri = { "scheme", "user:pass", "host", 1234, "/path/to/dir",
{{"query", NULL}, {"key", "value"}}, "fragment"},
.str = "scheme://user:pass@host:1234/path/to/dir?query&key=value#fragment"
},
{.uri = {"scheme", "user:pass", "host", 1234, "/path/to/dir",
{{"query", NULL}, {"key", "value"}}, "fragment"},
.str =
"scheme://user:pass@host:1234/path/to/dir?query&key=value#fragment"},
/* IPv6 literal should render in square brackets */
{ .uri = { "scheme", "user:pass", "12:34:56:78:9a:bc:de:f0", 1234,
"/path/to/dir", {{"query", "value"}}, "fragment"},
.str = "scheme://user:pass@[12:34:56:78:9a:bc:de:f0]:1234/path/to/dir?query=value#fragment" },
{.uri = {"scheme", "user:pass", "12:34:56:78:9a:bc:de:f0", 1234,
"/path/to/dir", {{"query", "value"}}, "fragment"},
.str =
"scheme://user:pass@[12:34:56:78:9a:bc:de:f0]:1234/path/to/dir?query=value#fragment"},
};
GST_START_TEST (test_url_presenting)
@ -390,11 +391,11 @@ GST_START_TEST (test_url_presenting)
for (i = 0; i < G_N_ELEMENTS (url_presenting_tests); i++) {
uri = gst_uri_new (url_presenting_tests[i].uri.scheme,
url_presenting_tests[i].uri.userinfo,
url_presenting_tests[i].uri.host,
url_presenting_tests[i].uri.port,
url_presenting_tests[i].uri.path,
NULL, url_presenting_tests[i].uri.fragment);
url_presenting_tests[i].uri.userinfo,
url_presenting_tests[i].uri.host,
url_presenting_tests[i].uri.port,
url_presenting_tests[i].uri.path,
NULL, url_presenting_tests[i].uri.fragment);
fail_unless (uri != NULL);
for (j = 0; j < 10; j++) {
if (!url_presenting_tests[i].uri.query[j].key)