Author: thatsafunnyname
Date: Thu Mar 26 06:24:04 2009
New Revision: 726

Modified:
    trunk/bin/nytprofhtml

Log:
Use quotemeta() to backslash non-'word' chars.

Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml       (original)
+++ trunk/bin/nytprofhtml       Thu Mar 26 06:24:04 2009
@@ -481,11 +481,8 @@
              }

              my $href = $reporter->get_file_stats()->{$filename}{html_safe}  
|| "unknown";
-           # if $filename conatins F-2 (NYTPROF-2??) then get error - invalid  
regexp range in line below, F-2
-           my $filename_with_regexp_escaped = $filename;
-            $filename_with_regexp_escaped =~ s/\-/\\-/g;
-            $filename_with_regexp_escaped =~ s/\[/\\[/g;
-            $filename_with_regexp_escaped =~ s/\]/\\]/g;
+
+           my $filename_with_regexp_escaped = quotemeta($filename);
              $line_desc =~ s/ of $filename_with_regexp_escaped$// if  
$filename eq $thisfile;

              push @prologue,

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to