add comments to fsetupcmd init

This commit is contained in:
Radim Kolar 2009-09-15 15:43:59 +02:00
parent e37d784eca
commit abfce62c10

View File

@ -76,10 +76,15 @@ int main (int argc, char ** argv)
struct passwd *pw=0L; struct passwd *pw=0L;
struct fsp_host *setup=NULL; struct fsp_host *setup=NULL;
/* Determine user home directory, try to use password file first
fallback to $HOME.
*/
log = (char *)getlogin(); log = (char *)getlogin();
if (log) pw = getpwnam(log); if (log) pw = getpwnam(log);
if (!pw) pw = getpwuid(getuid()); if (!pw) pw = getpwuid(getuid());
if (pw) { 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"); csh = !strcmp(pw->pw_shell + strlen(pw->pw_shell) - 3, "csh");
home = pw->pw_dir; /* for default search for file .fspsites */ home = pw->pw_dir; /* for default search for file .fspsites */
} else } else