From d70a9eb611a9d242c1d26847d223b8677609305b Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 28 Jul 2020 20:37:20 -0400 Subject: strvec: rename struct fields The "argc" and "argv" names made sense when the struct was argv_array, but now they're just confusing. Let's rename them to "nr" (which we use for counts elsewhere) and "v" (which is rather terse, but reads well when combined with typical variable names like "args.v"). Note that we have to update all of the callers immediately. Playing tricks with the preprocessor is hard here, because we wouldn't want to rewrite unrelated tokens. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/helper/test-run-command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/helper/test-run-command.c') diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index 726835fcc2..7ae03dc712 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -248,7 +248,7 @@ static int quote_stress_test(int argc, const char **argv) else strvec_pushl(&args, "test-tool", "run-command", "quote-echo", NULL); - arg_offset = args.argc; + arg_offset = args.nr; if (argc > 0) { trials = 1; @@ -275,13 +275,13 @@ static int quote_stress_test(int argc, const char **argv) if (i < skip) continue; - cp.argv = args.argv; + cp.argv = args.v; strbuf_reset(&out); if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0) return error("Failed to spawn child process"); for (j = 0, k = 0; j < arg_count; j++) { - const char *arg = args.argv[j + arg_offset]; + const char *arg = args.v[j + arg_offset]; if (strcmp(arg, out.buf + k)) ret = error("incorrectly quoted arg: '%s', " @@ -298,7 +298,7 @@ static int quote_stress_test(int argc, const char **argv) fprintf(stderr, "Trial #%d failed. Arguments:\n", i); for (j = 0; j < arg_count; j++) fprintf(stderr, "arg #%d: '%s'\n", - (int)j, args.argv[j + arg_offset]); + (int)j, args.v[j + arg_offset]); strbuf_release(&out); strvec_clear(&args); -- cgit v1.2.1