Merge pull request #212 from soveran/io-read-eof
Change IO.read to return null on EOF
This commit is contained in:
+2
-4
@@ -120,11 +120,9 @@ static void ioRead(WrenVM* vm)
|
||||
char buffer[MAX_READ_LEN];
|
||||
char* result = fgets(buffer, MAX_READ_LEN, stdin);
|
||||
|
||||
if (result == NULL) {
|
||||
// TODO: handle error.
|
||||
if (result != NULL) {
|
||||
wrenReturnString(vm, buffer, (int)strlen(buffer));
|
||||
}
|
||||
|
||||
wrenReturnString(vm, buffer, (int)strlen(buffer));
|
||||
}
|
||||
|
||||
static void ioClock(WrenVM* vm)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
IO.write(IO.read) // expect: null
|
||||
Reference in New Issue
Block a user