From: Junio C Hamano Date: Wed, 3 Oct 2007 10:06:02 +0000 (-0700) Subject: Merge branch 'ph/strbuf' X-Git-Tag: v1.5.4-rc0~387 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=66d4035e1099477aa488c24c0c081ee764f85868;p=git.git Merge branch 'ph/strbuf' * ph/strbuf: (44 commits) Make read_patch_file work on a strbuf. strbuf_read_file enhancement, and use it. strbuf change: be sure ->buf is never ever NULL. double free in builtin-update-index.c Clean up stripspace a bit, use strbuf even more. Add strbuf_read_file(). rerere: Fix use of an empty strbuf.buf Small cache_tree_write refactor. Make builtin-rerere use of strbuf nicer and more efficient. Add strbuf_cmp. strbuf_setlen(): do not barf on setting length of an empty buffer to 0 sq_quote_argv and add_to_string rework with strbuf's. Full rework of quote_c_style and write_name_quoted. Rework unquote_c_style to work on a strbuf. strbuf API additions and enhancements. nfv?asprintf are broken without va_copy, workaround them. Fix the expansion pattern of the pseudo-static path buffer. builtin-for-each-ref.c::copy_name() - do not overstep the buffer. builtin-apply.c: fix a tiny leak introduced during xmemdupz() conversion. Use xmemdupz() in many places. ... --- 66d4035e1099477aa488c24c0c081ee764f85868 diff --cc builtin-for-each-ref.c index 5dbf3e59f,e868a4b6d..c74ef2800 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@@ -346,19 -320,12 +331,12 @@@ static const char *copy_email(const cha { const char *email = strchr(buf, '<'); const char *eoemail = strchr(email, '>'); - char *line; - int len; if (!email || !eoemail) return ""; - eoemail++; - len = eoemail - email; - line = xmalloc(len + 1); - memcpy(line, email, len); - line[len] = 0; - return line; + return xmemdupz(email, eoemail + 1 - email); } -static void grab_date(const char *buf, struct atom_value *v) +static void grab_date(const char *buf, struct atom_value *v, const char *atomname) { const char *eoemail = strstr(buf, "> "); char *zone; diff --cc merge-recursive.c index 97dcf9bf0,86767e6e8..4a5c77c3b --- a/merge-recursive.c +++ b/merge-recursive.c @@@ -96,11 -90,10 +90,11 @@@ static struct path_list current_directo static int call_depth = 0; static int verbosity = 2; +static int rename_limit = -1; static int buffer_output = 1; - static struct output_buffer *output_list, *output_end; + static struct strbuf obuf = STRBUF_INIT; - static int show (int v) + static int show(int v) { return (!call_depth && verbosity >= v) || verbosity >= 5; }