archive/bz2: fixed indentation

This commit is contained in:
Max Kellermann 2009-12-15 08:55:46 +01:00
parent 357037f7ab
commit e3597e648c

View File

@ -48,7 +48,6 @@ typedef struct {
char *buffer; char *buffer;
} bz2_context; } bz2_context;
static const struct input_plugin bz2_inputplugin; static const struct input_plugin bz2_inputplugin;
/* single archive handling allocation helpers */ /* single archive handling allocation helpers */
@ -99,6 +98,7 @@ bz2_open(char * pathname)
g_free(context); g_free(context);
return NULL; return NULL;
} }
//capture filename //capture filename
name = strrchr(pathname, '/'); name = strrchr(pathname, '/');
if (name == NULL) { if (name == NULL) {
@ -106,12 +106,15 @@ bz2_open(char * pathname)
g_free(context); g_free(context);
return NULL; return NULL;
} }
context->name = g_strdup(name + 1); context->name = g_strdup(name + 1);
//remove suffix //remove suffix
len = strlen(context->name); len = strlen(context->name);
if (len > 4) { if (len > 4) {
context->name[len - 4] = 0; //remove .bz2 suffix context->name[len - 4] = 0; //remove .bz2 suffix
} }
return (struct archive_file *) context; return (struct archive_file *) context;
} }
@ -127,10 +130,12 @@ bz2_scan_next(struct archive_file *file)
{ {
bz2_context *context = (bz2_context *) file; bz2_context *context = (bz2_context *) file;
char *name = NULL; char *name = NULL;
if (context->reset) { if (context->reset) {
name = context->name; name = context->name;
context->reset = false; context->reset = false;
} }
return name; return name;
} }
@ -138,6 +143,7 @@ static void
bz2_close(struct archive_file *file) bz2_close(struct archive_file *file)
{ {
bz2_context *context = (bz2_context *) file; bz2_context *context = (bz2_context *) file;
if (context->name) if (context->name)
g_free(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) G_GNUC_UNUSED const char *path)
{ {
bz2_context *context = (bz2_context *) file; bz2_context *context = (bz2_context *) file;
//setup file ops //setup file ops
is->plugin = &bz2_inputplugin; is->plugin = &bz2_inputplugin;
//insert back reference //insert back reference
@ -162,6 +169,7 @@ bz2_open_stream(struct archive_file *file, struct input_stream *is,
g_warning("alloc bz2 failed\n"); g_warning("alloc bz2 failed\n");
return false; return false;
} }
return true; return true;
} }
@ -174,8 +182,7 @@ bz2_is_close(struct input_stream *is)
} }
static int static int
bz2_fillbuffer(bz2_context *context, bz2_fillbuffer(bz2_context *context, size_t numBytes)
size_t numBytes)
{ {
size_t count; size_t count;
bz_stream *bzstream; bz_stream *bzstream;