summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-21 07:45:40 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-21 07:45:40 (GMT)
commit3c144afe50b58875a41ea56ef118f41be7bf605a (patch)
tree7d68b348862205a33f72d57fb7719f6dfa16920e
parent0080f50eb333192617739c9954a30611cc0adeaa (diff)
parent0dec30b9788b12fdae5d5b69fc366a28bb688d80 (diff)
downloadgit-3c144afe50b58875a41ea56ef118f41be7bf605a.zip
git-3c144afe50b58875a41ea56ef118f41be7bf605a.tar.gz
git-3c144afe50b58875a41ea56ef118f41be7bf605a.tar.bz2
Merge branch 'fix'
* fix: fix pack-object buffer size mailinfo: decode underscore used in "Q" encoding properly. Reintroduce svn pools to solve the memory leak. pack-objects: do not stop at object that is "too small"
-rwxr-xr-xgit-svnimport.perl4
-rw-r--r--mailinfo.c12
-rw-r--r--pack-objects.c4
3 files changed, 12 insertions, 8 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 60ed7ae..61f559f0 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -136,8 +136,10 @@ sub file {
print "... $rev $path ...\n" if $opt_v;
my (undef, $properties);
+ my $pool = SVN::Pool->new();
eval { (undef, $properties)
- = $self->{'svn'}->get_file($path,$rev,$fh); };
+ = $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
+ $pool->clear;
if($@) {
return undef if $@ =~ /Attempted to get checksum/;
die $@;
diff --git a/mailinfo.c b/mailinfo.c
index 3c56f8c..b276519 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -405,7 +405,7 @@ static unsigned hexval(int c)
return ~0;
}
-static int decode_q_segment(char *in, char *ot, char *ep)
+static int decode_q_segment(char *in, char *ot, char *ep, int rfc2047)
{
int c;
while ((c = *in++) != 0 && (in <= ep)) {
@@ -414,9 +414,11 @@ static int decode_q_segment(char *in, char *ot, char *ep)
if (d == '\n' || !d)
break; /* drop trailing newline */
*ot++ = ((hexval(d) << 4) | hexval(*in++));
+ continue;
}
- else
- *ot++ = c;
+ if (rfc2047 && c == '_') /* rfc2047 4.2 (2) */
+ c = 0x20;
+ *ot++ = c;
}
*ot = 0;
return 0;
@@ -547,7 +549,7 @@ static void decode_header_bq(char *it)
sz = decode_b_segment(cp + 3, piecebuf, ep);
break;
case 'q':
- sz = decode_q_segment(cp + 3, piecebuf, ep);
+ sz = decode_q_segment(cp + 3, piecebuf, ep, 1);
break;
}
if (sz < 0)
@@ -569,7 +571,7 @@ static void decode_transfer_encoding(char *line)
switch (transfer_encoding) {
case TE_QP:
ep = line + strlen(line);
- decode_q_segment(line, line, ep);
+ decode_q_segment(line, line, ep, 0);
break;
case TE_BASE64:
ep = line + strlen(line);
diff --git a/pack-objects.c b/pack-objects.c
index 09f4f2c..c0acc46 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -1052,7 +1052,7 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
if (cur_entry->delta)
max_size = cur_entry->delta_size-1;
if (sizediff >= max_size)
- return -1;
+ return 0;
delta_buf = diff_delta(old->data, oldsize,
cur->data, size, &delta_size, max_size);
if (!delta_buf)
@@ -1231,7 +1231,7 @@ static void setup_progress_signal(void)
int main(int argc, char **argv)
{
SHA_CTX ctx;
- char line[PATH_MAX + 20];
+ char line[40 + 1 + PATH_MAX + 2];
int window = 10, depth = 10, pack_to_stdout = 0;
struct object_entry **list;
int num_preferred_base = 0;