diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-18 20:11:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-18 20:11:25 +0000 |
commit | be53d7f298bb81297ff0d186f9ddb585a2e57198 (patch) | |
tree | f461c861805dc1694884e772a7c07bfe64f14a3d /cmd-set-option.c | |
parent | 0d5ad358ae3bc80cbf226f5aef5790ca1e1f430c (diff) |
More Sun OS crap.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index f9242ae4..36e8fffd 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.29 2008-06-18 18:52:44 nicm Exp $ */ +/* $Id: cmd-set-option.c,v 1.30 2008-06-18 20:11:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -105,7 +105,7 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx) struct options *oo; const char *errstr; u_int i; - int number, bool, key; + int number, flag, key; u_char colour; if (data == NULL) @@ -128,15 +128,15 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx) if (errstr != NULL) number = 0; - bool = -1; + flag = -1; if (number == 1 || strcasecmp(data->value, "on") == 0 || strcasecmp(data->value, "yes") == 0) - bool = 1; + flag = 1; else if (number == 0 || strcasecmp(data->value, "off") == 0 || strcasecmp(data->value, "no") == 0) - bool = 0; + flag = 0; } else - bool = -2; + flag = -2; if (strcmp(data->option, "prefix") == 0) { if (data->value == NULL) { @@ -150,13 +150,13 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx) } options_set_key(oo, "prefix-key", key); } else if (strcmp(data->option, "status") == 0) { - if (bool == -1) { + if (flag == -1) { ctx->error(ctx, "bad value: %s", data->value); return; } - if (bool == -2) - bool = !options_get_number(oo, "status-lines"); - options_set_number(oo, "status-lines", bool); + if (flag == -2) + flag = !options_get_number(oo, "status-lines"); + options_set_number(oo, "status-lines", flag); recalculate_sizes(); } else if (strcmp(data->option, "status-fg") == 0) { if (data->value == NULL) { @@ -273,13 +273,13 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx) } options_set_number(oo, "status-interval", number); } else if (strcmp(data->option, "set-titles") == 0) { - if (bool == -1) { + if (flag == -1) { ctx->error(ctx, "bad value: %s", data->value); return; } - if (bool == -2) - bool = !options_get_number(oo, "set-titles"); - options_set_number(oo, "set-titles", bool); + if (flag == -2) + flag = !options_get_number(oo, "set-titles"); + options_set_number(oo, "set-titles", flag); } else { ctx->error(ctx, "unknown option: %s", data->option); return; |