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.
This commit is contained in:
parent
2bfac015d3
commit
9298631316
Notes:
git
2020-06-29 11:06:54 +09:00
@ -1886,8 +1886,7 @@ check_exec_redirect_fd(VALUE v, int iskey)
|
|||||||
fd = fptr->fd;
|
fd = fptr->fd;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wrong:
|
goto wrong;
|
||||||
rb_raise(rb_eArgError, "wrong exec redirect");
|
|
||||||
}
|
}
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
rb_raise(rb_eArgError, "negative file descriptor");
|
rb_raise(rb_eArgError, "negative file descriptor");
|
||||||
@ -1898,6 +1897,9 @@ check_exec_redirect_fd(VALUE v, int iskey)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return INT2FIX(fd);
|
return INT2FIX(fd);
|
||||||
|
|
||||||
|
wrong:
|
||||||
|
rb_raise(rb_eArgError, "wrong exec redirect");
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user