Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 182:59ffb6d4b34c legacy-trunk
Use fileobject's filegetline() to implement unlimited raw_input().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 04 Apr 1991 15:20:41 +0000 |
| parents | 853b736a6a9e |
| children | 6693c5d87f3a |
line wrap: on
line diff
--- a/Python/bltinmodule.c Thu Apr 04 10:49:03 1991 +0000 +++ b/Python/bltinmodule.c Thu Apr 04 15:20:41 1991 +0000 @@ -436,29 +436,11 @@ object *self; object *v; { - FILE *in = sysgetfile("stdin", stdin); FILE *out = sysgetfile("stdout", stdout); - char *p; - int err; - int n = 1000; flushline(); if (v != NULL) printobject(v, out, PRINT_RAW); - v = newsizedstringobject((char *)NULL, n); - if (v != NULL) { - if ((err = fgets_intr(getstringvalue(v), n+1, in)) != E_OK) { - err_input(err); - DECREF(v); - return NULL; - } - else { - n = strlen(getstringvalue(v)); - if (n > 0 && getstringvalue(v)[n-1] == '\n') - n--; - resizestring(&v, n); - } - } - return v; + return filegetline(sysget("stdin"), -1); } static object *
