summaryrefslogtreecommitdiffstats
path: root/login-utils/newgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils/newgrp.c')
-rw-r--r--login-utils/newgrp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/login-utils/newgrp.c b/login-utils/newgrp.c
index 85cba7752..983993416 100644
--- a/login-utils/newgrp.c
+++ b/login-utils/newgrp.c
@@ -138,7 +138,8 @@ int main(int argc, char *argv[])
if (!(pw_entry = getpwuid(getuid())))
err(EXIT_FAILURE, _("who are you?"));
- shell = (pw_entry->pw_shell[0] ? pw_entry->pw_shell : _PATH_BSHELL);
+ shell = (pw_entry->pw_shell && *pw_entry->pw_shell ?
+ pw_entry->pw_shell : _PATH_BSHELL);
if (argc < 2) {
if (setgid(pw_entry->pw_gid) < 0)