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
131cb059
Commit
131cb059
authored
Dec 31, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/iso9660: set input_stream.{size,offset}
parent
9862521a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
iso9660_archive_plugin.c
src/archive/iso9660_archive_plugin.c
+8
-8
No files found.
src/archive/iso9660_archive_plugin.c
View file @
131cb059
...
...
@@ -39,7 +39,6 @@ struct iso9660_archive_file {
iso9660_t
*
iso
;
iso9660_stat_t
*
statbuf
;
size_t
cur_ofs
;
size_t
max_blocks
;
GSList
*
list
;
GSList
*
iter
;
...
...
@@ -179,7 +178,9 @@ iso9660_archive_open_stream(struct archive_file *file, struct input_stream *is,
"not found in the ISO file: %s"
,
pathname
);
return
false
;
}
context
->
cur_ofs
=
0
;
is
->
size
=
context
->
statbuf
->
size
;
context
->
max_blocks
=
CEILING
(
context
->
statbuf
->
size
,
ISO_BLOCKSIZE
);
return
true
;
}
...
...
@@ -200,7 +201,7 @@ iso9660_input_read(struct input_stream *is, void *ptr, size_t size, GError **err
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
is
->
data
;
int
toread
,
readed
=
0
;
int
no_blocks
,
cur_block
;
size_t
left_bytes
=
context
->
statbuf
->
size
-
context
->
cur_ofs
;
size_t
left_bytes
=
context
->
statbuf
->
size
-
is
->
offset
;
size
=
(
size
*
ISO_BLOCKSIZE
)
/
ISO_BLOCKSIZE
;
...
...
@@ -213,7 +214,7 @@ iso9660_input_read(struct input_stream *is, void *ptr, size_t size, GError **err
}
if
(
no_blocks
>
0
)
{
cur_block
=
context
->
cur_ofs
/
ISO_BLOCKSIZE
;
cur_block
=
is
->
offset
/
ISO_BLOCKSIZE
;
readed
=
iso9660_iso_seek_read
(
context
->
iso
,
ptr
,
context
->
statbuf
->
lsn
+
cur_block
,
no_blocks
);
...
...
@@ -227,7 +228,8 @@ iso9660_input_read(struct input_stream *is, void *ptr, size_t size, GError **err
if
(
left_bytes
<
size
)
{
readed
=
left_bytes
;
}
context
->
cur_ofs
+=
readed
;
is
->
offset
+=
readed
;
}
return
readed
;
}
...
...
@@ -235,9 +237,7 @@ iso9660_input_read(struct input_stream *is, void *ptr, size_t size, GError **err
static
bool
iso9660_input_eof
(
struct
input_stream
*
is
)
{
struct
iso9660_archive_file
*
context
=
is
->
data
;
return
(
context
->
cur_ofs
==
context
->
statbuf
->
size
);
return
is
->
offset
==
is
->
size
;
}
/* exported structures */
...
...
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