Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1c73323d
Commit
1c73323d
authored
Jan 08, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few reformats; no logic changes.
parent
8628206b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
Objects/fileobject.c
Objects/fileobject.c
+8
-9
No files found.
Objects/fileobject.c
View file @
1c73323d
...
...
@@ -639,12 +639,12 @@ Win32 MS routine to get next line.
Under MSVC 6:
+ MS threadsafe getc is very slow (multiple layers of function calls
before+
after each character, to lock+unlock the stream).
+ The stream-locking functions are MS-internal -- can't access them
from user
code.
+ There's nothing Tim could find in the MS C or platform SDK libraries
that
can worm around this.
+ MS threadsafe getc is very slow (multiple layers of function calls
before+
after each character, to lock+unlock the stream).
+ The stream-locking functions are MS-internal -- can't access them
from user
code.
+ There's nothing Tim could find in the MS C or platform SDK libraries
that
can worm around this.
+ MS fgets locks/unlocks only once per line; it's the only hook we have.
So we use fgets for speed(!), despite that it's painful.
...
...
@@ -731,12 +731,11 @@ ms_getline_hack(FILE *fp)
}
/* yuck: fgets overwrote all the newlines, i.e. the entire buffer.
* So this line isn't over yet, or maybe it is but we're exactly at
*EOF; in either case, we're tired <wink>.
*
EOF; in either case, we're tired <wink>.
*/
assert
(
msbuf
[
INITBUFSIZE
-
1
]
==
'\0'
);
total_v_size
=
INITBUFSIZE
+
INCBUFSIZE
;
v
=
PyString_FromStringAndSize
((
char
*
)
NULL
,
(
int
)
total_v_size
);
v
=
PyString_FromStringAndSize
((
char
*
)
NULL
,
(
int
)
total_v_size
);
if
(
v
==
NULL
)
return
v
;
/* copy over everything except the last null byte */
...
...
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