From c2015b3ae0d52ccae33ee00c2b25b8402c66bdf0 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 4 Nov 2007 21:26:22 +0100 Subject: Fix an infinite loop in sq_quote_buf(). sq_quote_buf() treats single-quotes and exclamation marks specially, but it incorrectly parsed the input for single-quotes and backslashes. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- quote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quote.c') diff --git a/quote.c b/quote.c index 482be05b7a..919d0920ab 100644 --- a/quote.c +++ b/quote.c @@ -26,7 +26,7 @@ void sq_quote_buf(struct strbuf *dst, const char *src) strbuf_addch(dst, '\''); while (*src) { - size_t len = strcspn(src, "'\\"); + size_t len = strcspn(src, "'!"); strbuf_add(dst, src, len); src += len; while (need_bs_quote(*src)) { -- cgit v1.2.1