A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-January/011396.html below:

[Python-Dev] Rehabilitating fgets

[Python-Dev] Rehabilitating fgetsTim Peters tim.one@home.com
Sun, 7 Jan 2001 23:13:26 -0500
The "Win32" readline() hack is now checked in, but there's really nothing
Win32-specific about it anymore.  It makes one mild assumption about what
the C std doesn't clearly address but may have intended:  that in case of a
non-NULL return, fgets doesn't overwrite any of the buffer positions beyond
the terminating null byte (the std is clear that it doesn't overwrite
anything at all in case of a NULL-because-EOF return, but I can't say
whether they're pointing that out as a consequence, or pointing that out as
an exception).

I'm curious about how it performs (relative to the getc_unlocked hack) on
other platforms.  If you'd like to try that, just recompile fileobject.c
with

    USE_MS_GETLINE_HACK

#define'd.  It should *work* on any platform with fgets() meeting the
assumption.  The new test_bufio.py std test gives it a pretty good
correctness workout, if you're worried about that.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4