display-time option to set message display time.

This commit is contained in:
Nicholas Marriott
2008-06-19 23:20:45 +00:00
parent 7cebf4768b
commit a1db273dc2
4 changed files with 30 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-option.c,v 1.32 2008-06-19 22:04:02 nicm Exp $ */
/* $Id: cmd-set-option.c,v 1.33 2008-06-19 23:20:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -236,6 +236,20 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx)
return;
}
options_set_number(oo, "history-limit", number);
} else if (strcmp(data->option, "display-time") == 0) {
if (data->value == NULL || number == -1) {
ctx->error(ctx, "invalid value");
return;
}
if (errstr != NULL) {
ctx->error(ctx, "display-time %s", errstr);
return;
}
if (number > INT_MAX) {
ctx->error(ctx, "display-time too big: %u", number);
return;
}
options_set_number(oo, "display-time", number);
} else if (strcmp(data->option, "status-left") == 0) {
if (data->value == NULL) {
ctx->error(ctx, "invalid value");