From 7121c4d4e2877115fb372b3f147fad4cd1306751 Mon Sep 17 00:00:00 2001 From: ZheNing Hu Date: Mon, 26 Jul 2021 03:26:48 +0000 Subject: ref-filter: --format=%(raw) support --perl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because the perl language can handle binary data correctly, add the function perl_quote_buf_with_len(), which can specify the length of the data and prevent the data from being truncated at '\0' to help `--format="%(raw)"` support `--perl`. Reviewed-by: Jacob Keller Helped-by: Ævar Arnfjörð Bjarmason Signed-off-by: ZheNing Hu Signed-off-by: Junio C Hamano --- quote.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quote.h') diff --git a/quote.h b/quote.h index 768cc6338e..0fe69e264b 100644 --- a/quote.h +++ b/quote.h @@ -94,6 +94,7 @@ char *quote_path(const char *in, const char *prefix, struct strbuf *out, unsigne /* quoting as a string literal for other languages */ void perl_quote_buf(struct strbuf *sb, const char *src); +void perl_quote_buf_with_len(struct strbuf *sb, const char *src, size_t len); void python_quote_buf(struct strbuf *sb, const char *src); void tcl_quote_buf(struct strbuf *sb, const char *src); void basic_regex_quote_buf(struct strbuf *sb, const char *src); -- cgit v1.2.3