diff options
author | 卜部昌平 <[email protected]> | 2020-06-16 12:27:33 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2020-06-29 11:05:41 +0900 |
commit | 92986313161c36157187ed7078fc4909bbf9bc04 (patch) | |
tree | ea653f7f1d4d8c264e2ace96944ce05c5b88e47b /process.c | |
parent | 2bfac015d3742408d0c4d9f2220413992d0e49c6 (diff) |
check_exec_redirect_fd: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1886,8 +1886,7 @@ check_exec_redirect_fd(VALUE v, int iskey) fd = fptr->fd; } else { - wrong: - rb_raise(rb_eArgError, "wrong exec redirect"); + goto wrong; } if (fd < 0) { rb_raise(rb_eArgError, "negative file descriptor"); @@ -1898,6 +1897,9 @@ check_exec_redirect_fd(VALUE v, int iskey) } #endif return INT2FIX(fd); + + wrong: + rb_raise(rb_eArgError, "wrong exec redirect"); } static VALUE |