Rename a member to match what it will be in future.

This commit is contained in:
nicm 2021-08-21 10:28:05 +00:00
parent 08e6360f23
commit 110ba767e5
11 changed files with 17 additions and 19 deletions

View File

@ -128,7 +128,7 @@ args_free(struct args *args)
RB_REMOVE(args_tree, &args->tree, entry);
TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) {
TAILQ_REMOVE(&entry->values, value, entry);
free(value->value);
free(value->string);
free(value);
}
free(entry);
@ -210,7 +210,7 @@ args_print(struct args *args)
args_print_add(&buf, &len, " -%c", entry->flag);
else
args_print_add(&buf, &len, "-%c", entry->flag);
args_print_add_argument(&buf, &len, value->value);
args_print_add_argument(&buf, &len, value->string);
}
}
@ -299,7 +299,7 @@ args_set(struct args *args, u_char flag, const char *s)
if (s != NULL) {
value = xcalloc(1, sizeof *value);
value->value = xstrdup(s);
value->string = xstrdup(s);
TAILQ_INSERT_TAIL(&entry->values, value, entry);
}
}
@ -314,7 +314,7 @@ args_get(struct args *args, u_char flag)
return (NULL);
if (TAILQ_EMPTY(&entry->values))
return (NULL);
return (TAILQ_LAST(&entry->values, args_values)->value);
return (TAILQ_LAST(&entry->values, args_values)->string);
}
/* Get first argument. */
@ -387,7 +387,7 @@ args_strtonum(struct args *args, u_char flag, long long minval,
}
value = TAILQ_LAST(&entry->values, args_values);
ll = strtonum(value->value, minval, maxval, &errstr);
ll = strtonum(value->string, minval, maxval, &errstr);
if (errstr != NULL) {
*cause = xstrdup(errstr);
return (0);
@ -409,7 +409,7 @@ args_percentage(struct args *args, u_char flag, long long minval,
*cause = xstrdup("missing");
return (0);
}
value = TAILQ_LAST(&entry->values, args_values)->value;
value = TAILQ_LAST(&entry->values, args_values)->string;
return (args_string_percentage(value, minval, maxval, curval, cause));
}

View File

@ -271,7 +271,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
environ_update(global_s_options, c->environ, env);
av = args_first_value(args, 'e');
while (av != NULL) {
environ_put(env, av->value, 0);
environ_put(env, av->string, 0);
av = args_next_value(av);
}
s = session_create(prefix, newname, cwd, env, oo, tiop);

View File

@ -110,7 +110,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
av = args_first_value(args, 'e');
while (av != NULL) {
environ_put(sc.environ, av->value, 0);
environ_put(sc.environ, av->string, 0);
av = args_next_value(av);
}

View File

@ -413,7 +413,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item,
av = args_first_value(args, flag);
while (av != NULL) {
xsnprintf(tmp, sizeof tmp, "hook_flag_%c_%d", flag, i);
cmdq_add_format(new_state, tmp, "%s", av->value);
cmdq_add_format(new_state, tmp, "%s", av->string);
i++;
av = args_next_value(av);
}

View File

@ -187,7 +187,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
goto not_control_client;
av = args_first_value(args, 'A');
while (av != NULL) {
cmd_refresh_client_update_offset(tc, av->value);
cmd_refresh_client_update_offset(tc, av->string);
av = args_next_value(av);
}
return (CMD_RETURN_NORMAL);
@ -197,7 +197,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
goto not_control_client;
av = args_first_value(args, 'B');
while (av != NULL) {
cmd_refresh_client_update_subscription(tc, av->value);
cmd_refresh_client_update_subscription(tc, av->string);
av = args_next_value(av);
}
return (CMD_RETURN_NORMAL);

View File

@ -98,8 +98,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
if (args_count(args) == 0)
adjust = 1;
else {
adjust = strtonum(args_string(args, 0), 1, INT_MAX,
&errstr);
adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr);
if (errstr != NULL) {
cmdq_error(item, "adjustment %s", errstr);
return (CMD_RETURN_ERROR);

View File

@ -59,8 +59,7 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item)
if (args_count(args) == 0)
adjust = 1;
else {
adjust = strtonum(args_string(args, 0), 1, INT_MAX,
&errstr);
adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr);
if (errstr != NULL) {
cmdq_error(item, "adjustment %s", errstr);
return (CMD_RETURN_ERROR);

View File

@ -69,7 +69,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmdq_item *item)
av = args_first_value(args, 'e');
while (av != NULL) {
environ_put(sc.environ, av->value, 0);
environ_put(sc.environ, av->string, 0);
av = args_next_value(av);
}

View File

@ -67,7 +67,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmdq_item *item)
av = args_first_value(args, 'e');
while (av != NULL) {
environ_put(sc.environ, av->value, 0);
environ_put(sc.environ, av->string, 0);
av = args_next_value(av);
}

View File

@ -142,7 +142,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
av = args_first_value(args, 'e');
while (av != NULL) {
environ_put(sc.environ, av->value, 0);
environ_put(sc.environ, av->string, 0);
av = args_next_value(av);
}

2
tmux.h
View File

@ -1357,7 +1357,7 @@ TAILQ_HEAD(message_list, message_entry);
/* Argument value. */
struct args_value {
char *value;
char *string;
TAILQ_ENTRY(args_value) entry;
};