]> git.ipfire.org Git - thirdparty/git.git/blobdiff - mailinfo.c
Merge branch 'jk/mailinfo-iterative-unquote-comment'
[thirdparty/git.git] / mailinfo.c
index 968186421623d45011bae29637b2e9cc111abdc7..94b9b0abf228b891bc1df5a71bcd96807ed982a8 100644 (file)
@@ -59,6 +59,7 @@ static void parse_bogus_from(struct mailinfo *mi, const struct strbuf *line)
 static const char *unquote_comment(struct strbuf *outbuf, const char *in)
 {
        int take_next_literally = 0;
+       int depth = 1;
 
        strbuf_addch(outbuf, '(');
 
@@ -72,11 +73,14 @@ static const char *unquote_comment(struct strbuf *outbuf, const char *in)
                                take_next_literally = 1;
                                continue;
                        case '(':
-                               in = unquote_comment(outbuf, in);
+                               strbuf_addch(outbuf, '(');
+                               depth++;
                                continue;
                        case ')':
                                strbuf_addch(outbuf, ')');
-                               return in;
+                               if (!--depth)
+                                       return in;
+                               continue;
                        }
                }