From fcd963fcf1a72c5237739aa035be5d2f3bfa6ca8 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 20 Apr 2005 00:55:09 +0000 Subject: Bug 272623: FindWrapPoint is misplaced in process_bug.cgi - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CGI.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index db8b8e27f..ec0d8909c 100644 --- a/CGI.pl +++ b/CGI.pl @@ -48,6 +48,10 @@ use Bugzilla::BugMail; use Bugzilla::Bug; use Bugzilla::User; +# Used in LogActivityEntry(). Gives the max length of lines in the +# activity table. +use constant MAX_LINE_LENGTH => 254; + # Shut up misguided -w warnings about "used only once". For some reason, # "use vars" chokes on me when I try it here. @@ -254,16 +258,16 @@ sub LogActivityEntry { # into multiple entries if it's too long. while ($removed || $added) { my ($removestr, $addstr) = ($removed, $added); - if (length($removestr) > 254) { - my $commaposition = FindWrapPoint($removed, 254); + if (length($removestr) > MAX_LINE_LENGTH) { + my $commaposition = find_wrap_point($removed, MAX_LINE_LENGTH); $removestr = substr($removed,0,$commaposition); $removed = substr($removed,$commaposition); $removed =~ s/^[,\s]+//; # remove any comma or space } else { $removed = ""; # no more entries } - if (length($addstr) > 254) { - my $commaposition = FindWrapPoint($added, 254); + if (length($addstr) > MAX_LINE_LENGTH) { + my $commaposition = find_wrap_point($added, MAX_LINE_LENGTH); $addstr = substr($added,0,$commaposition); $added = substr($added,$commaposition); $added =~ s/^[,\s]+//; # remove any comma or space -- cgit v1.2.3-24-g4f1b