> ==
> STk-3.99.1/Src/port.c :
> ==
> PRIMITIVE STk_read_line(SCM port)
> {
> :
> for (i = 0; ; i++) {
> switch (c = Getc(f)) {
> case EOF: if (i == 0) { free(buff); return STk_eof_object; }
> case '\r': i--; continue;
> case '\n': res = STk_makestrg(i, buff); free(buff); return res;
> default: if (i == size) {
> size += size / 2;
> buff = must_realloc(buff, size);
> :
> ==
Apparently this should be:
for (i = 0; ; i++) {
switch (c = Getc(f)) {
case EOF: if (i == 0) { free(buff); return STk_eof_object; }
case '\n': res = STk_makestrg(i, buff); free(buff); return res;
case '\r': i--; continue;
default: if (i == size) {
size += size / 2;
buff = must_realloc(buff, size);
I looked at the source of 3.1.1 and found it used fallthough from EOF
case into '\n' case (and had no '\r' case).
--
Shiro KAWAI
Square USA Inc. Honolulu Studio R&D division
#"The most important things are the hardest things to say" --- Stephen King
Received on Tue May 26 1998 - 01:14:44 CEST