From abfce62c1098b330e36a4e6d756b581c0f7bfedb Mon Sep 17 00:00:00 2001 From: Radim Kolar <> Date: Tue, 15 Sep 2009 15:43:59 +0200 Subject: [PATCH] add comments to fsetupcmd init --- clients/fsetupcmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clients/fsetupcmd.c b/clients/fsetupcmd.c index d120102..e98205b 100644 --- a/clients/fsetupcmd.c +++ b/clients/fsetupcmd.c @@ -75,11 +75,16 @@ int main (int argc, char ** argv) char *log; struct passwd *pw=0L; struct fsp_host *setup=NULL; - + + /* Determine user home directory, try to use password file first + fallback to $HOME. + */ log = (char *)getlogin(); if (log) pw = getpwnam(log); if (!pw) pw = getpwuid(getuid()); if (pw) { + /* Load default shell type from password file. We will check + for $SHELL later */ csh = !strcmp(pw->pw_shell + strlen(pw->pw_shell) - 3, "csh"); home = pw->pw_dir; /* for default search for file .fspsites */ } else