kripken/emscripten — pull request #2945 by aidanhs (2014-10-30 16:48:36+00:00)
Title: Fix ungetc on nodefs

I made the proposed change in #2266 since it appears to be inactive.

When poking around with making a test, I found that there's already a test for ungetc on memfs which filfills the need for a regression test. So I hooked the test up to nodefs, only to discover that it miserably fails because nodefs doesn't clear ungotten on llseek.

I've therefore moved the resetting of self.ungotten one level up, out of the fs-specific implementations and into the generic library_fs wrappers. This means new filesystems automatically get it right and the test passes.