[gnome-builder/gnome-builder-3-28] terminal: simplify getent call
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] terminal: simplify getent call
- Date: Thu, 22 Mar 2018 21:03:12 +0000 (UTC)
commit 2ba58ba43f736fda5f3c1260c1eb176e1b84330f
Author: Christian Hergert <chergert redhat com>
Date: Thu Mar 22 13:59:39 2018 -0700
terminal: simplify getent call
We don't need information on all users, just the user we care about. So
this doesn't need a grep.
#439
src/libide/terminal/ide-terminal-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libide/terminal/ide-terminal-util.c b/src/libide/terminal/ide-terminal-util.c
index 9bb0e0ed1..bd2ade4ac 100644
--- a/src/libide/terminal/ide-terminal-util.c
+++ b/src/libide/terminal/ide-terminal-util.c
@@ -109,7 +109,7 @@ _ide_guess_shell (void)
if ((shell = vte_get_user_shell ()))
user_shell = g_strdup (shell);
- command = g_strdup_printf ("sh -c 'getent passwd | grep ^%s: | head -n1 | cut -f 7 -d :'",
+ command = g_strdup_printf ("sh -c 'getent passwd %s | head -n1 | cut -f 7 -d :'",
g_get_user_name ());
if (!g_shell_parse_argv (command, NULL, &argv, &error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]