mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
pty.c: dry up
* ext/pty/pty.c (establishShell): gather initializations by the default shell path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
00a2285917
commit
89a7e87cd4
1 changed files with 1 additions and 5 deletions
|
@ -164,7 +164,7 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
|
|||
char errbuf[32];
|
||||
|
||||
if (argc == 0) {
|
||||
const char *shellname;
|
||||
const char *shellname = "/bin/sh";
|
||||
|
||||
if ((p = getenv("SHELL")) != NULL) {
|
||||
shellname = p;
|
||||
|
@ -175,10 +175,6 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
|
|||
struct passwd *pwent = getpwnam(username ? username : getlogin());
|
||||
if (pwent && pwent->pw_shell)
|
||||
shellname = pwent->pw_shell;
|
||||
else
|
||||
shellname = "/bin/sh";
|
||||
#else
|
||||
shellname = "/bin/sh";
|
||||
#endif
|
||||
}
|
||||
v = rb_str_new2(shellname);
|
||||
|
|
Loading…
Reference in a new issue