Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
84158d84
Commit
84158d84
authored
Oct 01, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem in seek method. The seek method should (and now does) fill with nulls
when seeking past the end of the "file".
parent
eba4b092
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
lib/Components/cPickle/cStringIO.c
lib/Components/cPickle/cStringIO.c
+15
-4
No files found.
lib/Components/cPickle/cStringIO.c
View file @
84158d84
/*
/*
$Id: cStringIO.c,v 1.2
4 1998/05/05 14:53:4
5 jim Exp $
$Id: cStringIO.c,v 1.2
5 1998/10/01 22:24:2
5 jim Exp $
A simple fast partial StringIO replacement.
A simple fast partial StringIO replacement.
...
@@ -85,7 +85,7 @@ static char cStringIO_module_documentation[] =
...
@@ -85,7 +85,7 @@ static char cStringIO_module_documentation[] =
"If someone else wants to provide a more complete implementation,
\n
"
"If someone else wants to provide a more complete implementation,
\n
"
"go for it. :-)
\n
"
"go for it. :-)
\n
"
"
\n
"
"
\n
"
"$Id: cStringIO.c,v 1.2
4 1998/05/05 14:53:4
5 jim Exp $
\n
"
"$Id: cStringIO.c,v 1.2
5 1998/10/01 22:24:2
5 jim Exp $
\n
"
;
;
#include "Python.h"
#include "Python.h"
...
@@ -152,8 +152,19 @@ O_seek(Oobject *self, PyObject *args) {
...
@@ -152,8 +152,19 @@ O_seek(Oobject *self, PyObject *args) {
position
+=
self
->
pos
;
position
+=
self
->
pos
;
}
}
self
->
pos
=
(
position
>
self
->
string_size
?
self
->
string_size
:
if
(
position
>
self
->
buf_size
)
{
(
position
<
0
?
0
:
position
));
self
->
buf_size
*=
2
;
if
(
self
->
buf_size
<=
position
)
self
->
buf_size
=
position
+
1
;
UNLESS
(
self
->
buf
=
(
char
*
)
realloc
(
self
->
buf
,
self
->
buf_size
*
sizeof
(
char
)))
{
self
->
buf_size
=
self
->
pos
=
0
;
return
PyErr_NoMemory
();
}
}
else
if
(
position
<
0
)
position
=
0
;
self
->
pos
=
position
;
while
(
--
position
>=
self
->
string_size
)
self
->
buf
[
position
]
=
0
;
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
return
Py_None
;
return
Py_None
;
...
...
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