summaryrefslogtreecommitdiffstats
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-23 12:48:20 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-23 12:48:20 +0000
commit9c584432d0bccdc61560e3e9deff0421f1039068 (patch)
tree684a877409f4584ef5097036f729dd6ae97e5b0c /cmd-set-option.c
parent26c8303733c243b2181bb644ce6fa2b838de8e15 (diff)
history-limit option.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index e6a89432..70a4c3e4 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-set-option.c,v 1.13 2007-11-16 21:12:31 nicm Exp $ */
+/* $Id: cmd-set-option.c,v 1.14 2007-11-23 12:48:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -193,6 +193,16 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx)
}
xfree(default_command);
default_command = xstrdup(data->value);
+ } else if (strcmp(data->option, "history-limit") == 0) {
+ if (data->value == NULL) {
+ ctx->error(ctx, "invalid value");
+ return;
+ }
+ if (number > SHRT_MAX) {
+ ctx->error(ctx, "history-limit too big: %u", number);
+ return;
+ }
+ history_limit = number;
} else {
ctx->error(ctx, "unknown option: %s", data->option);
return;