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
74167c1e
Commit
74167c1e
authored
Feb 26, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_path2ri: set errno to disthinguish errors (refs #10792)
parent
90b73bf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
src/text/url.c
src/text/url.c
+11
-1
No files found.
src/text/url.c
View file @
74167c1e
...
...
@@ -23,6 +23,7 @@
# include "config.h"
#endif
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
...
...
@@ -147,12 +148,15 @@ char *encode_URI_component (const char *str)
* @param path path to convert (or URI to copy)
* @param scheme URI scheme to use (default is auto: "file", "fd" or "smb")
* @return a nul-terminated URI string (use free() to release it),
* or NULL in case of error
* or NULL in case of error
(errno will be set accordingly)
*/
char
*
vlc_path2uri
(
const
char
*
path
,
const
char
*
scheme
)
{
if
(
path
==
NULL
)
{
errno
=
EINVAL
;
return
NULL
;
}
if
(
scheme
==
NULL
&&
!
strcmp
(
path
,
"-"
))
return
strdup
(
"fd://0"
);
// standard input
/* Note: VLC cannot handle URI schemes without double slash after the
...
...
@@ -180,7 +184,10 @@ char *vlc_path2uri (const char *path, const char *scheme)
path
+=
2
;
# warning Drive letter-relative path not implemented!
if
(
path
[
0
]
!=
DIR_SEP_CHAR
)
{
errno
=
ENOTSUP
;
return
NULL
;
}
}
else
#endif
...
...
@@ -188,7 +195,10 @@ char *vlc_path2uri (const char *path, const char *scheme)
{
/* Windows UNC paths */
#if !defined( _WIN32 ) && !defined( __OS2__ )
if
(
scheme
!=
NULL
)
{
errno
=
ENOTSUP
;
return
NULL
;
/* remote files not supported */
}
/* \\host\share\path -> smb://host/share/path */
if
(
strchr
(
path
+
2
,
'\\'
)
!=
NULL
)
...
...
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