strvec: convert more callers away from argv_array name
We eventually want to drop the argv_array name and just use strvec consistently. There's no particular reason we have to do it all at once, or care about interactions between converted and unconverted bits. Because of our preprocessor compat layer, the names are interchangeable to the compiler (so even a definition and declaration using different names is OK). This patch converts remaining files from the first half of the alphabet, to keep the diff to a manageable size. The conversion was done purely mechanically with: git ls-files '*.c' '*.h' | xargs perl -i -pe ' s/ARGV_ARRAY/STRVEC/g; s/argv_array/strvec/g; ' and then selectively staging files with "git add '[abcdefghjkl]*'". We'll deal with any indentation/style fallouts separately. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
22f9b7f3f5
commit
ef8d7ac42a
@ -18,8 +18,8 @@ void open_in_gdb(void)
|
||||
static struct child_process cp = CHILD_PROCESS_INIT;
|
||||
extern char *_pgmptr;
|
||||
|
||||
argv_array_pushl(&cp.args, "mintty", "gdb", NULL);
|
||||
argv_array_pushf(&cp.args, "--pid=%d", getpid());
|
||||
strvec_pushl(&cp.args, "mintty", "gdb", NULL);
|
||||
strvec_pushf(&cp.args, "--pid=%d", getpid());
|
||||
cp.clean_on_exit = 1;
|
||||
if (start_command(&cp) < 0)
|
||||
die_errno("Could not start gdb");
|
||||
|
@ -86,9 +86,9 @@ static void restore_term(void)
|
||||
if (stty_restore.nr == 0)
|
||||
return;
|
||||
|
||||
argv_array_push(&cp.args, "stty");
|
||||
strvec_push(&cp.args, "stty");
|
||||
for (i = 0; i < stty_restore.nr; i++)
|
||||
argv_array_push(&cp.args, stty_restore.items[i].string);
|
||||
strvec_push(&cp.args, stty_restore.items[i].string);
|
||||
run_command(&cp);
|
||||
string_list_clear(&stty_restore, 0);
|
||||
return;
|
||||
@ -107,25 +107,25 @@ static int disable_bits(DWORD bits)
|
||||
if (use_stty) {
|
||||
struct child_process cp = CHILD_PROCESS_INIT;
|
||||
|
||||
argv_array_push(&cp.args, "stty");
|
||||
strvec_push(&cp.args, "stty");
|
||||
|
||||
if (bits & ENABLE_LINE_INPUT) {
|
||||
string_list_append(&stty_restore, "icanon");
|
||||
argv_array_push(&cp.args, "-icanon");
|
||||
strvec_push(&cp.args, "-icanon");
|
||||
}
|
||||
|
||||
if (bits & ENABLE_ECHO_INPUT) {
|
||||
string_list_append(&stty_restore, "echo");
|
||||
argv_array_push(&cp.args, "-echo");
|
||||
strvec_push(&cp.args, "-echo");
|
||||
}
|
||||
|
||||
if (bits & ENABLE_PROCESSED_INPUT) {
|
||||
string_list_append(&stty_restore, "-ignbrk");
|
||||
string_list_append(&stty_restore, "intr");
|
||||
string_list_append(&stty_restore, "^c");
|
||||
argv_array_push(&cp.args, "ignbrk");
|
||||
argv_array_push(&cp.args, "intr");
|
||||
argv_array_push(&cp.args, "");
|
||||
strvec_push(&cp.args, "ignbrk");
|
||||
strvec_push(&cp.args, "intr");
|
||||
strvec_push(&cp.args, "");
|
||||
}
|
||||
|
||||
if (run_command(&cp) == 0)
|
||||
@ -273,7 +273,7 @@ static int is_known_escape_sequence(const char *sequence)
|
||||
hashmap_init(&sequences, (hashmap_cmp_fn)sequence_entry_cmp,
|
||||
NULL, 0);
|
||||
|
||||
argv_array_pushl(&cp.args, "infocmp", "-L", "-1", NULL);
|
||||
strvec_pushl(&cp.args, "infocmp", "-L", "-1", NULL);
|
||||
if (pipe_command(&cp, NULL, 0, &buf, 0, NULL, 0))
|
||||
strbuf_setlen(&buf, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user