diff options
author | Guido van Rossum <guido@python.org> | 1991-04-04 15:20:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-04-04 15:20:41 (GMT) |
commit | 26203aa42260e416a68e717f5723169c2f57b77c (patch) | |
tree | 950508c474dec907bc9aac7afc1901629d31733b /Python | |
parent | 6590d4a250f804999b8d2e1453afffac268818c6 (diff) | |
download | cpython-26203aa42260e416a68e717f5723169c2f57b77c.zip cpython-26203aa42260e416a68e717f5723169c2f57b77c.tar.gz cpython-26203aa42260e416a68e717f5723169c2f57b77c.tar.bz2 |
Use fileobject's filegetline() to implement unlimited raw_input().
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 1d7d838..08f34bc 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -436,29 +436,11 @@ builtin_raw_input(self, v) 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 * |