diff options
author | tim.dawborn <tim.dawborn@gmail.com> | 2011-06-23 13:50:19 +1000 |
---|---|---|
committer | tim.dawborn <tim.dawborn@gmail.com> | 2011-06-23 13:50:19 +1000 |
commit | 89ecb3e21c105df110a3c62a2d3366864fc5fe3c (patch) | |
tree | 787cede07897558a047b8da4295f35ba2d6c1b76 /src/library.js | |
parent | 68b06527633437767bbeaeb7cdf6a122db78ef56 (diff) |
* propogated return value from main back to the return value from Module.run
* improved the behaviour of ungetc
* added optional argument to intArrayFromString to not add the trailing NULL -- useful when adding JS strings as the data in the virtual file system
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 97f7f61e..4875c7dc 100644 --- a/src/library.js +++ b/src/library.js @@ -476,6 +476,11 @@ var Library = { _IO_getc: 'getc', ungetc: function(chr, stream) { + var f = STDIO.streams[stream]; + if (!f) + return -1; // EOF + if (!f.interactiveInput) + f.position--; return chr; }, |