[前][次][番号順一覧][スレッド一覧]

ruby-changes:42749

From: nobu <ko1@a...>
Date: Sat, 30 Apr 2016 09:16:16 +0900 (JST)
Subject: [ruby-changes:42749] nobu:r54823 (trunk): pty.c: dry up

nobu	2016-04-30 10:12:52 +0900 (Sat, 30 Apr 2016)

  New Revision: 54823

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54823

  Log:
    pty.c: dry up
    
    * ext/pty/pty.c (establishShell): gather initializations by the
      default shell path.

  Modified files:
    trunk/ext/pty/pty.c
Index: ext/pty/pty.c
===================================================================
--- ext/pty/pty.c	(revision 54822)
+++ ext/pty/pty.c	(revision 54823)
@@ -164,7 +164,7 @@ establishShell(int argc, VALUE *argv, st https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L164
     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, st https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L175
 	    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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]