]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'ph/strbuf'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Oct 2007 10:06:02 +0000 (03:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Oct 2007 10:06:02 +0000 (03:06 -0700)
* 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.
  ...

1  2 
builtin-apply.c
builtin-for-each-ref.c
builtin-ls-files.c
builtin-rev-list.c
cache.h
diff.c
merge-recursive.c
sha1_file.c

diff --cc builtin-apply.c
Simple merge
index 5dbf3e59f297b1849c1289b7cc7980bddf1852f7,e868a4b6d7f2fe59437ccab12ea7a9b16f4a2163..c74ef2800c839a5537707c5c64aa55acb2a9efad
@@@ -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;
Simple merge
Simple merge
diff --cc cache.h
Simple merge
diff --cc diff.c
Simple merge
index 97dcf9bf02d8f382ba63cfeef9d6dcb792c62f76,86767e6e8a37ce7874aa80b789cfef780fa9b136..4a5c77c3b632a9c0636848b933ef5395b01b7103
@@@ -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;
  }
diff --cc sha1_file.c
Simple merge