Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Fix uninitialized @name member in person.rb.
@ 2009-09-25 20:46 Carl Worth
  2009-09-26 17:45 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Carl Worth @ 2009-09-25 20:46 UTC (permalink / raw)


Apparently a Person can be initialized with a nil name, (presumably
from a message where there's no name given), which before this commit
resulted in the following warning:

./lib/sup/person.rb:46: warning: instance variable @name not initialized

This warning was especially unpleasant since it appeared in the current
window, causing the terminal contents to incorrectly scroll up, (as
opposed to just appearing in the log or so).
---
 lib/sup/person.rb |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/sup/person.rb b/lib/sup/person.rb
index c4f40a5..cd5b1ea 100644
--- a/lib/sup/person.rb
+++ b/lib/sup/person.rb
@@ -11,6 +11,8 @@ class Person
       if @name =~ /^(['"]\s*)(.*?)(\s*["'])$/
         @name = $2
       end
+    else
+      @name = nil
     end
 
     @email = email.gsub(/^\s+|\s+$/, "").gsub(/\s+/, " ").downcase
-- 
1.6.4.3


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090925/26a4d1df/attachment.bin>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [sup-talk] [PATCH] Fix uninitialized @name member in person.rb.
  2009-09-25 20:46 [sup-talk] [PATCH] Fix uninitialized @name member in person.rb Carl Worth
@ 2009-09-26 17:45 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2009-09-26 17:45 UTC (permalink / raw)


Reformatted excerpts from Carl Worth's message of 2009-09-25:
> Apparently a Person can be initialized with a nil name, (presumably
> from a message where there's no name given), which before this commit
> resulted in the following warning:
>
> ./lib/sup/person.rb:46: warning: instance variable @name not initialized

Thanks, I have fixed this in master. Let me know if it doesn't work!
-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-26 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25 20:46 [sup-talk] [PATCH] Fix uninitialized @name member in person.rb Carl Worth
2009-09-26 17:45 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox