summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-11-04 20:26:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-04 23:16:59 (GMT)
commitc2015b3ae0d52ccae33ee00c2b25b8402c66bdf0 (patch)
tree89cbc34d7def468e193b431bacb07c88d305cb9a /quote.c
parent140dd77a5cb2e61dcb942e245a2474fae95e42a5 (diff)
downloadgit-c2015b3ae0d52ccae33ee00c2b25b8402c66bdf0.zip
git-c2015b3ae0d52ccae33ee00c2b25b8402c66bdf0.tar.gz
git-c2015b3ae0d52ccae33ee00c2b25b8402c66bdf0.tar.bz2
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 <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/quote.c b/quote.c
index 482be05..919d092 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)) {