Bugzilla – Attachment 12159 Details for
Bug 8761
Correct compile time warnings in C4::Circulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8761 Dont inadvertantly use slices
Bug-8761-Dont-inadvertantly-use-slices.patch (text/plain), 1.65 KB, created by
Chris Cormack
on 2012-09-12 07:43:09 UTC
(
hide
)
Description:
Bug 8761 Dont inadvertantly use slices
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-09-12 07:43:09 UTC
Size:
1.65 KB
patch
obsolete
>From 6b66e34b17499f580af4c9067270ca93602f8abe Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 11 Sep 2012 18:49:35 +0100 >Subject: [PATCH] Bug 8761 Dont inadvertantly use slices > >Assignment to a single element slice is better written >as a scalar - This generates a compile time warning as it >can lead to odd behaviour see perldiag for details >This corrects some cases which were added in a recent >commit > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/Circulation.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 8bd53b9..273c6f3 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -982,16 +982,16 @@ sub CanBookBeIssued { > # Index points to the next value > my $restrictionyear = 0; > if (($take <= $#values) && ($take >= 0)){ >- $restrictionyear += @values[$take]; >+ $restrictionyear += $values[$take]; > } > > if ($restrictionyear > 0) { > if ( $borrower->{'dateofbirth'} ) { > my @alloweddate = split /-/,$borrower->{'dateofbirth'} ; >- @alloweddate[0] += $restrictionyear; >+ $alloweddate[0] += $restrictionyear; > #Prevent runime eror on leap year (invalid date) >- if ((@alloweddate[1] == 2) && (@alloweddate[2] == 29)) { >- @alloweddate[2] = 28; >+ if (($alloweddate[1] == 2) && ($alloweddate[2] == 29)) { >+ $alloweddate[2] = 28; > } > > if ( Date_to_Days(Today) < Date_to_Days(@alloweddate) -1 ) { >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8761
:
12144
| 12159