From dd5c7be5680375cc33f9ec71dee7ed392e894f9c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 26 Oct 1990 14:58:11 +0000 Subject: [PATCH] Reads of zero should be legal! --- Objects/fileobject.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index be4f3005ec9..7eb6f5c1ee4 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -1,5 +1,10 @@ /* File object implementation */ +/* XXX This should become a built-in module 'io'. It should support more + functionality, better exception handling for invalid calls, etc. + It should also cooperate with posix to support popen(), which should + share most code but have a special close function. */ + #include #include "PROTO.h" @@ -142,7 +147,7 @@ fileread(f, args) return NULL; } n = getintvalue(args); - if (n <= 0 /* || n > 0x7fff /*XXX*/ ) { + if (n < 0) { errno = EDOM; return NULL; }