summaryrefslogtreecommitdiff
path: root/src/eggshell.c
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-11-06 19:14:03 -0300
committerPerberos <[email protected]>2011-11-06 19:14:03 -0300
commitf2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e (patch)
tree5bc248a29ae93e5534428e6908a94d50d419ceb9 /src/eggshell.c
parentdef492f92d29f294c62d94ef562dd6271bd9b84b (diff)
downloadmate-terminal-f2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e.tar.bz2
mate-terminal-f2a13175e5a3a38d1340d2fff5e03f8c2e0d8f8e.tar.xz
aplicando formato allman
Diffstat (limited to 'src/eggshell.c')
-rw-r--r--src/eggshell.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/eggshell.c b/src/eggshell.c
index ff4d2ce..0a83d85 100644
--- a/src/eggshell.c
+++ b/src/eggshell.c
@@ -60,7 +60,8 @@ egg_shell (const char *shell)
#ifndef G_OS_WIN32
struct passwd *pw;
int i;
- static const char shells [][14] = {
+ static const char shells [][14] =
+ {
/* Note that on some systems shells can also
* be installed in /usr/bin */
"/bin/bash", "/usr/bin/bash",
@@ -71,23 +72,30 @@ egg_shell (const char *shell)
};
if (geteuid () == getuid () &&
- getegid () == getgid ()) {
+ getegid () == getgid ())
+ {
/* only in non-setuid */
- if (shell != NULL) {
- if (access (shell, X_OK) == 0) {
+ if (shell != NULL)
+ {
+ if (access (shell, X_OK) == 0)
+ {
return g_strdup (shell);
}
}
}
pw = getpwuid(getuid());
- if (pw && pw->pw_shell) {
- if (access (pw->pw_shell, X_OK) == 0) {
+ if (pw && pw->pw_shell)
+ {
+ if (access (pw->pw_shell, X_OK) == 0)
+ {
return g_strdup (pw->pw_shell);
}
}
- for (i = 0; i != G_N_ELEMENTS (shells); i++) {
- if (access (shells [i], X_OK) == 0) {
+ for (i = 0; i != G_N_ELEMENTS (shells); i++)
+ {
+ if (access (shells [i], X_OK) == 0)
+ {
return g_strdup (shells[i]);
}
}