From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F35C0205CC; Mon, 11 Apr 2016 05:20:49 +0000 (UTC) Date: Mon, 11 Apr 2016 05:20:49 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/3] import: use bytes::length for true data length in bytes Message-ID: <20160411052049.GA26650@dcvr.yhbt.net> References: <20160409091457.14741-1-e@80x24.org> <20160409091457.14741-4-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160409091457.14741-4-e@80x24.org> List-Id: git is byte-oriented and fast-import will not tolerate miscalculations. This is necessary for wide characters in commit messages (email Subjects). --- lib/PublicInbox/Import.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 4c7bbf1..5bae69d 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -168,7 +168,7 @@ sub add { print $w "commit $ref\nmark :$commit\n", "author $name <$email> $date\n", "committer $self->{ident} ", now2822(), "\n", - "data ", (length($subject) + 1), "\n", + "data ", (bytes::length($subject) + 1), "\n", $subject, "\n\n" or wfail; binmode $w, ':raw' or die "binmode :raw failed: $!"; -- EW