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

popen: support nil in second argument #460

Merged
merged 1 commit into from Oct 14, 2023
Merged

Conversation

0x501D
Copy link
Contributor

@0x501D 0x501D commented Oct 9, 2023

In the C implementation of the Lua interpreter,
in the io.popen function the second argument can be nil:

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

x,y = io.popen("ls", nil)
assert(x)
assert(y == nil)

Gopher lua throws an exception:
bad argument #2 to popen (string expected, got nil)

Closes #459

@coveralls
Copy link

coveralls commented Oct 9, 2023

Coverage Status

coverage: 89.97% (+0.004%) from 89.966% when pulling 1543e9d on 0x501D:fix-gh-459 into 2b3f02d on yuin:master.

In the C implementation of the Lua interpreter,
in the io.popen function the second argument can be nil:

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

> x,y = io.popen("ls", nil)
> assert(x)
> assert(y == nil)
>

Gopher lua throws an exception:
bad argument yuin#2 to popen (string expected, got nil)

Closes yuin#459
@yuin yuin merged commit 018eaa0 into yuin:master Oct 14, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

different behavior in io.popen function
3 participants