Use home from struct passwd if HOME is empty as well as if it is NULL, and fix

a style nit. Both from Tiago Cunha.
This commit is contained in:
Nicholas Marriott
2009-11-21 17:52:18 +00:00
parent 58688c48aa
commit 9b9d26f80e
2 changed files with 2 additions and 3 deletions

3
cmd.c
View File

@ -278,9 +278,8 @@ cmd_free(struct cmd *cmd)
size_t
cmd_print(struct cmd *cmd, char *buf, size_t len)
{
if (cmd->entry->print == NULL) {
if (cmd->entry->print == NULL)
return (xsnprintf(buf, len, "%s", cmd->entry->name));
}
return (cmd->entry->print(cmd, buf, len));
}