From 9c35c24400f4ec9fd993990e2b22d5a2a3e81dce Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 9 Dec 2006 01:34:04 -0800 Subject: [PATCH] Avoid using an uninitialized value if has no backquotes inside. --- WikiConverter/Markdown.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/WikiConverter/Markdown.pm b/WikiConverter/Markdown.pm index b79e3d9..0f887d0 100644 --- a/WikiConverter/Markdown.pm +++ b/WikiConverter/Markdown.pm @@ -179,7 +179,8 @@ sub _code { my $text = $self->get_elem_contents($node); my @list = sort { length($b) cmp length($a) } ($text =~ /`+/g); - return "`" . $list[0] . $text . $list[0] . "`"; + my $longest_backquotes = $list[0] || ""; + return "`" . $longest_backquotes . $text . $longest_backquotes . "`"; } sub _pre { -- 1.4.4.2