Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iolib: fix different behavior in read function #456

Merged
merged 1 commit into from
Dec 12, 2023

Commits on Dec 11, 2023

  1. iolib: fix different behavior in read function

    $ lua
    Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    > file = "/tmp"
    > fd, _, code = io.open(file, "r")
    > _, _, ecode = fd:read(1)
    > print(ecode)
    21
    >
    
    gopher-lua throws an exception:
            read /tmp: is a directory
    stack traceback:
            [G]: in function 'read'
            extra/wrapper.lua:17: in function 'exec'
            <string>:1: in main chunk
            [G]: ?
    
    This patch results in behavior similar to the vanilla lua
    implementation.
    
    Closes yuin#455
    0x501D committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    5b5b27f View commit details
    Browse the repository at this point in the history