Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
95c3f283
Commit
95c3f283
authored
Dec 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/file: don't fall back to parent directory
This code has never made any sense, and has broken some of the archive plugin.
parent
aef6609f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
18 deletions
+3
-18
file_input_plugin.c
src/input/file_input_plugin.c
+3
-18
No files found.
src/input/file_input_plugin.c
View file @
95c3f283
...
...
@@ -38,25 +38,14 @@ input_file_open(struct input_stream *is, const char *filename)
int
fd
,
ret
;
struct
stat
st
;
char
*
pathname
=
g_strdup
(
filename
);
if
(
!
g_path_is_absolute
(
filename
))
{
g_free
(
pathname
);
return
false
;
}
if
(
stat
(
filename
,
&
st
)
<
0
)
{
char
*
slash
=
strrchr
(
pathname
,
'/'
);
*
slash
=
'\0'
;
}
fd
=
open_cloexec
(
pathname
,
O_RDONLY
,
0
);
fd
=
open_cloexec
(
filename
,
O_RDONLY
,
0
);
if
(
fd
<
0
)
{
is
->
error
=
errno
;
g_debug
(
"Failed to open
\"
%s
\"
: %s"
,
pathname
,
g_strerror
(
errno
));
g_free
(
pathname
);
filename
,
g_strerror
(
errno
));
return
false
;
}
...
...
@@ -66,15 +55,13 @@ input_file_open(struct input_stream *is, const char *filename)
if
(
ret
<
0
)
{
is
->
error
=
errno
;
close
(
fd
);
g_free
(
pathname
);
return
false
;
}
if
(
!
S_ISREG
(
st
.
st_mode
))
{
g_debug
(
"Not a regular file: %s"
,
path
name
);
g_debug
(
"Not a regular file: %s"
,
file
name
);
is
->
error
=
EINVAL
;
close
(
fd
);
g_free
(
pathname
);
return
false
;
}
...
...
@@ -88,8 +75,6 @@ input_file_open(struct input_stream *is, const char *filename)
is
->
data
=
GINT_TO_POINTER
(
fd
);
is
->
ready
=
true
;
g_free
(
pathname
);
return
true
;
}
...
...
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