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
e3597e64
Commit
e3597e64
authored
Dec 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bz2: fixed indentation
parent
357037f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
bz2_plugin.c
src/archive/bz2_plugin.c
+13
-6
No files found.
src/archive/bz2_plugin.c
View file @
e3597e64
...
...
@@ -48,7 +48,6 @@ typedef struct {
char
*
buffer
;
}
bz2_context
;
static
const
struct
input_plugin
bz2_inputplugin
;
/* single archive handling allocation helpers */
...
...
@@ -85,7 +84,7 @@ bz2_destroy(bz2_context *data)
/* archive open && listing routine */
static
struct
archive_file
*
bz2_open
(
char
*
pathname
)
bz2_open
(
char
*
pathname
)
{
bz2_context
*
context
;
char
*
name
;
...
...
@@ -99,6 +98,7 @@ bz2_open(char * pathname)
g_free
(
context
);
return
NULL
;
}
//capture filename
name
=
strrchr
(
pathname
,
'/'
);
if
(
name
==
NULL
)
{
...
...
@@ -106,12 +106,15 @@ bz2_open(char * pathname)
g_free
(
context
);
return
NULL
;
}
context
->
name
=
g_strdup
(
name
+
1
);
context
->
name
=
g_strdup
(
name
+
1
);
//remove suffix
len
=
strlen
(
context
->
name
);
if
(
len
>
4
)
{
context
->
name
[
len
-
4
]
=
0
;
//remove .bz2 suffix
context
->
name
[
len
-
4
]
=
0
;
//remove .bz2 suffix
}
return
(
struct
archive_file
*
)
context
;
}
...
...
@@ -127,10 +130,12 @@ bz2_scan_next(struct archive_file *file)
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
char
*
name
=
NULL
;
if
(
context
->
reset
)
{
name
=
context
->
name
;
context
->
reset
=
false
;
}
return
name
;
}
...
...
@@ -138,6 +143,7 @@ static void
bz2_close
(
struct
archive_file
*
file
)
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
if
(
context
->
name
)
g_free
(
context
->
name
);
...
...
@@ -152,6 +158,7 @@ bz2_open_stream(struct archive_file *file, struct input_stream *is,
G_GNUC_UNUSED
const
char
*
path
)
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
//setup file ops
is
->
plugin
=
&
bz2_inputplugin
;
//insert back reference
...
...
@@ -162,6 +169,7 @@ bz2_open_stream(struct archive_file *file, struct input_stream *is,
g_warning
(
"alloc bz2 failed
\n
"
);
return
false
;
}
return
true
;
}
...
...
@@ -174,8 +182,7 @@ bz2_is_close(struct input_stream *is)
}
static
int
bz2_fillbuffer
(
bz2_context
*
context
,
size_t
numBytes
)
bz2_fillbuffer
(
bz2_context
*
context
,
size_t
numBytes
)
{
size_t
count
;
bz_stream
*
bzstream
;
...
...
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