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
c3e0fbd9
Commit
c3e0fbd9
authored
Dec 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bz2: use g_path_get_basename()
Use g_path_get_basename() instead of manually filtering the path name. Big advantage: g_path_get_basename() cannot fail.
parent
b05ba028
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
bz2_plugin.c
src/archive/bz2_plugin.c
+1
-10
No files found.
src/archive/bz2_plugin.c
View file @
c3e0fbd9
...
...
@@ -98,7 +98,6 @@ static struct archive_file *
bz2_open
(
char
*
pathname
)
{
bz2_context
*
context
;
char
*
name
;
int
len
;
context
=
g_malloc
(
sizeof
(
*
context
));
...
...
@@ -110,15 +109,7 @@ bz2_open(char *pathname)
return
NULL
;
}
//capture filename
name
=
strrchr
(
pathname
,
'/'
);
if
(
name
==
NULL
)
{
g_warning
(
"failed to get bzip2 name from %s
\n
"
,
pathname
);
g_free
(
context
);
return
NULL
;
}
context
->
name
=
g_strdup
(
name
+
1
);
context
->
name
=
g_path_get_basename
(
pathname
);
//remove suffix
len
=
strlen
(
context
->
name
);
...
...
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