[BACK]Return to window.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/window.c between version 1.18 and 1.19

version 1.18, 2009/08/08 21:52:43 version 1.19, 2009/08/11 21:28:11
Line 61 
Line 61 
 const char *  const char *
 window_default_command(void)  window_default_command(void)
 {  {
         const char      *shell;          const char      *shell, *ptr;
         struct passwd   *pw;          struct passwd   *pw;
   
         shell = getenv("SHELL");          shell = getenv("SHELL");
         if (shell != NULL && *shell != '\0')          if (shell != NULL && *shell != '\0')
                 return (shell);                  goto found;
   
         pw = getpwuid(getuid());          pw = getpwuid(getuid());
         if (pw != NULL && pw->pw_shell != NULL && *pw->pw_shell != '\0')          if (pw != NULL && pw->pw_shell != NULL && *pw->pw_shell != '\0') {
                 return (pw->pw_shell);                  shell = pw->pw_shell;
                   goto found;
           }
   
         return (_PATH_BSHELL);          return (_PATH_BSHELL);
   
   found:
           if ((ptr = strrchr(shell, '/')) != NULL)
                   ptr++;
           else
                   ptr = shell;
           if (strcmp(ptr, __progname) == 0)
                   return (_PATH_BSHELL);
           return (shell);
 }  }
   
 int  int

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19