diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 01:12:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 01:12:52 +0000 |
commit | 4229bf2c1703b703f41a59971ed4cdca86b1181c (patch) | |
tree | d2e4cdbc5d235e0b288411cec73dfb9438c4ebd6 | |
parent | d7d5b8e731501c696cc4a440e07d7fee2f06b712 (diff) | |
download | ruby-4229bf2c1703b703f41a59971ed4cdca86b1181c.tar.gz |
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
-rw-r--r-- | ext/pty/pty.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 8340e96f1d..2ac412cfbc 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -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); |