Support command sequences separated by " ; ". Also clean up command printing.

This commit is contained in:
Nicholas Marriott
2009-01-18 14:40:48 +00:00
parent c4d5989a4e
commit a15f8fc4a6
23 changed files with 350 additions and 143 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-password.c,v 1.1 2009-01-11 00:48:42 nicm Exp $ */
/* $Id: cmd-set-password.c,v 1.2 2009-01-18 14:40:48 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -33,7 +33,7 @@ void cmd_set_password_send(struct cmd *, struct buffer *);
void cmd_set_password_recv(struct cmd *, struct buffer *);
void cmd_set_password_free(struct cmd *);
void cmd_set_password_init(struct cmd *, int);
void cmd_set_password_print(struct cmd *, char *, size_t);
size_t cmd_set_password_print(struct cmd *, char *, size_t);
struct cmd_set_password_data {
char *password;
@ -153,7 +153,7 @@ cmd_set_password_free(struct cmd *self)
xfree(data);
}
void
size_t
cmd_set_password_print(struct cmd *self, char *buf, size_t len)
{
struct cmd_set_password_data *data = self->data;
@ -161,9 +161,10 @@ cmd_set_password_print(struct cmd *self, char *buf, size_t len)
off += xsnprintf(buf, len, "%s", self->entry->name);
if (data == NULL)
return;
return (off);
if (off < len && data->flag_encrypted)
off += xsnprintf(buf + off, len - off, " -c");
if (off < len && data->password != NULL)
off += xsnprintf(buf + off, len - off, " password");
return (off);
}