Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
121973c1
Commit
121973c1
authored
Aug 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_UrlParse(): fix handling of port numbers
Pointed-out-by:
Aurélien Nephtali
<
aurelien.nephtali@gmail.com
>
parent
82074bd3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/text/url.c
src/text/url.c
+12
-8
No files found.
src/text/url.c
View file @
121973c1
...
@@ -454,24 +454,28 @@ void vlc_UrlParse (vlc_url_t *restrict url, const char *str, unsigned char opt)
...
@@ -454,24 +454,28 @@ void vlc_UrlParse (vlc_url_t *restrict url, const char *str, unsigned char opt)
}
}
/* Host name */
/* Host name */
if
(
*
cur
==
'['
&&
(
next
=
strstr
(
cur
,
"]:"
))
!=
NULL
)
if
(
*
cur
==
'['
&&
(
next
=
strrchr
(
cur
,
']'
))
!=
NULL
)
{
{
/* Try IPv6 numeral within brackets */
/* IPv6 numeral within brackets */
*
(
next
++
)
=
'\0'
;
*
(
next
++
)
=
'\0'
;
url
->
psz_host
=
strdup
(
cur
+
1
);
url
->
psz_host
=
strdup
(
cur
+
1
);
if
(
*
next
==
':'
)
next
++
;
else
next
=
NULL
;
}
}
else
else
{
{
url
->
psz_host
=
vlc_idna_to_ascii
(
cur
);
next
=
strchr
(
cur
,
':'
);
next
=
strchr
(
cur
,
':'
);
if
(
next
!=
NULL
)
*
(
next
++
)
=
'\0'
;
url
->
psz_host
=
vlc_idna_to_ascii
(
cur
);
}
}
/* Port number */
/* Port number */
if
(
next
!=
NULL
)
if
(
next
!=
NULL
)
{
url
->
i_port
=
atoi
(
next
);
assert
(
*
next
==
':'
);
url
->
i_port
=
atoi
(
next
+
1
);
}
if
(
url
->
psz_path
!=
NULL
)
if
(
url
->
psz_path
!=
NULL
)
*
url
->
psz_path
=
'/'
;
/* restore leading slash */
*
url
->
psz_path
=
'/'
;
/* restore leading slash */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment