Summary: | Fix Perl uninitialized warnings in VCSUtils::svnStatus() and VCSUtils::removeEOL(). | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||||
Component: | Tools / Tests | Assignee: | Daniel Bates <dbates> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | ddkilzer, mrobinson | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Description
Daniel Bates
2010-10-23 16:17:03 PDT
For completeness, I came across this issues when performing the following within the WebKit directory: 1. Download the patch for bug 6751 <https://bug-6751-attachments.webkit.org/attachment.cgi?id=71377> to ~/Desktop as Bug6751_2.patch 2. WebKitTools/Scripts/svn-apply ~/Desktop/Bug6751_2.patch. Then the output of svn-apply will contain: ... patching file LayoutTests/fast/frames/resources/frame-element-name-left.html patching file LayoutTests/fast/frames/resources/frame-element-name-right.html Use of uninitialized value $line in substitution (s///) at /Users/dbates/Desktop/WebKit/WebKitTools/Scripts/VCSUtils.pm line 417. Use of uninitialized value in concatenation (.) or string at /Users/dbates/Desktop/WebKit/WebKitTools/Scripts/VCSUtils.pm line 447. Notice the uninitialized value warnings. Created attachment 71660 [details]
Patch
Comment on attachment 71660 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=71660&action=review Is it possible to write a test for this? Maybe verify that removeEOL(undef) returns ""? > WebKitTools/Scripts/VCSUtils.pm:416 > + return unless $line; Why not do this? return "" unless $line; > WebKitTools/Scripts/VCSUtils.pm:447 > + $svnStatus = (removeEOL(<SVN>) || "") . "\n"; Then you don't have to do anything special here. (In reply to comment #3) > (From update of attachment 71660 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71660&action=review > > Is it possible to write a test for this? Maybe verify that removeEOL(undef) returns ""? Yes, we can write a test for this. We would need to export the function removeEOL. > > > WebKitTools/Scripts/VCSUtils.pm:416 > > + return unless $line; > > Why not do this? > > return "" unless $line; Will change. Created attachment 71668 [details]
Patch with unit test
Updated patch based on David Kilzer's comments. Added unit test.
Created attachment 71669 [details]
Patch with unit test
Fix copyright in unit test file removeEOL.pl.
Comment on attachment 71669 [details]
Patch with unit test
Thanks Dan! r=me
Comment on attachment 71669 [details] Patch with unit test Clearing flags on attachment: 71669 Committed r70415: <http://trac.webkit.org/changeset/70415> All reviewed patches have been landed. Closing bug. |