Re: [PATCH v2 2/6] pathspec: add new function to parse file
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 19, 2019, 05:59 UTC
- Message-ID
- <xmqqzhgsxv77.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <96697ba0724caee556f21ada3959c4190d80c0b9.1573055478.git.gitgitgadget@gmail.com>
"Alexandr Miloslavskiy via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> +void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,
> + unsigned flags, const char *prefix,
> + const char *file, int nul_term_line)
> +{
> + struct argv_array parsed_file = ARGV_ARRAY_INIT;
> + strbuf_getline_fn getline_fn = nul_term_line ? strbuf_getline_nul :
> + strbuf_getline;
> + struct strbuf buf = STRBUF_INIT;
> + struct strbuf unquoted = STRBUF_INIT;
> + FILE *in = NULL;Useless initialization to NULL can be dropped here.
> + if (!strcmp(file, "-")) > + in = stdin; > + else > + in = xfopen(file, "r");