diff options
author | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-10-17 17:04:19 -0200 |
---|---|---|
committer | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-10-17 17:04:19 -0200 |
commit | e9049cbfc91318f51c3d9efb867e4b9f07fcf750 (patch) | |
tree | 55f83ae52088d59436c0bac4555b958eb9d86392 /inout.c | |
parent | f8c8159362f4bb8820908085adcb06900ef33b4c (diff) | |
download | lua-e9049cbfc91318f51c3d9efb867e4b9f07fcf750.tar.gz lua-e9049cbfc91318f51c3d9efb867e4b9f07fcf750.tar.bz2 lua-e9049cbfc91318f51c3d9efb867e4b9f07fcf750.zip |
files end with EOF, instead of 0.
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -4,7 +4,7 @@ | |||
4 | ** facilities. | 4 | ** facilities. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | char *rcs_inout="$Id: inout.c,v 2.3 1994/09/05 21:22:43 celes Exp celes $"; | 7 | char *rcs_inout="$Id: inout.c,v 2.4 1994/10/11 14:38:17 celes Exp $"; |
8 | 8 | ||
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | #include <stdlib.h> | 10 | #include <stdlib.h> |
@@ -46,8 +46,7 @@ void lua_errorfunction (void (*fn) (char *s)) | |||
46 | */ | 46 | */ |
47 | static int fileinput (void) | 47 | static int fileinput (void) |
48 | { | 48 | { |
49 | int c = fgetc (fp); | 49 | return fgetc (fp); |
50 | return (c == EOF ? 0 : c); | ||
51 | } | 50 | } |
52 | 51 | ||
53 | /* | 52 | /* |
@@ -55,8 +54,7 @@ static int fileinput (void) | |||
55 | */ | 54 | */ |
56 | static int stringinput (void) | 55 | static int stringinput (void) |
57 | { | 56 | { |
58 | st++; | 57 | return *st++; |
59 | return (*(st-1)); | ||
60 | } | 58 | } |
61 | 59 | ||
62 | /* | 60 | /* |