Skip to content

Commit

Permalink
Fix a couple of other bugs with the fs rewrite
Browse files Browse the repository at this point in the history
 - Fix stdin not being considered a "readable" input
 - Return an unsigned byte rather than a signed one for no-args .read()
  • Loading branch information
SquidDev committed Oct 28, 2018
1 parent 03d140e commit 7074cad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -118,7 +118,7 @@ else if( count == 0 && m_seekable != null )
{ {
single.clear(); single.clear();
int b = m_reader.read( single ); int b = m_reader.read( single );
return b == -1 ? null : new Object[] { single.get( 0 ) }; return b == -1 ? null : new Object[] { single.get( 0 ) & 0xFF };
} }
} }
catch( IOException e ) catch( IOException e )
Expand Down
Expand Up @@ -63,7 +63,7 @@ handleMetatable = {
if self._closed then error("attempt to use a closed file", 2) end if self._closed then error("attempt to use a closed file", 2) end


local handle = self._handle local handle = self._handle
if not handle.read then return nil, "Not opened for reading" end if not handle.read and not handle.readLine then return nil, "Not opened for reading" end


local n = select('#', ...) local n = select('#', ...)
local output = {} local output = {}
Expand Down

0 comments on commit 7074cad

Please sign in to comment.