summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-04-20 02:55:09 +0200
committerlpsolit%gmail.com <>2005-04-20 02:55:09 +0200
commitfcd963fcf1a72c5237739aa035be5d2f3bfa6ca8 (patch)
treec587ce50c25f228eb65dd974cff09da40e994bb8 /CGI.pl
parent6d044219d11a994b16ee4af0a90cca75b57bee69 (diff)
downloadbugzilla-fcd963fcf1a72c5237739aa035be5d2f3bfa6ca8.tar.gz
bugzilla-fcd963fcf1a72c5237739aa035be5d2f3bfa6ca8.tar.xz
Bug 272623: FindWrapPoint is misplaced in process_bug.cgi - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl12
1 files changed, 8 insertions, 4 deletions
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