Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r19678: LJSUP-9157 (Self promo)

Committer: ailyin
LJSUP-9157 (Self promo)
U   trunk/bin/upgrading/texttool.pl
U   trunk/cgi-bin/LJ/MemCache.pm
Modified: trunk/bin/upgrading/texttool.pl
===================================================================
--- trunk/bin/upgrading/texttool.pl	2011-08-10 06:03:05 UTC (rev 19677)
+++ trunk/bin/upgrading/texttool.pl	2011-08-10 06:14:53 UTC (rev 19678)
@@ -603,10 +603,13 @@
                 my %metadata = $ldf->meta($code);
                 my $text     = $ldf->value($code);
 
-                $code = "$pfx$code";
                 if ( $code =~ /^[.]/ ) {
-                    die "Code in file $filename_short can't start "
-                        . "with a dot: $code";
+                    unless ($pfx) {
+                        die "Code in file $filename_short can't start "
+                            . "with a dot: $code";
+                    }
+
+                    $code = "$pfx$code";
                 }
 
                 # load existing items for target language

Modified: trunk/cgi-bin/LJ/MemCache.pm
===================================================================
--- trunk/cgi-bin/LJ/MemCache.pm	2011-08-10 06:03:05 UTC (rev 19677)
+++ trunk/cgi-bin/LJ/MemCache.pm	2011-08-10 06:14:53 UTC (rev 19678)
@@ -615,7 +615,7 @@
 
     my $value = LJ::MemCache::get($key);
 
-    unless ($value) {
+    unless ( defined $value ) {
         $value = $code->();
         LJ::MemCache::set( $key, $value, $expire );
     }

Tags: andy, livejournal, pl, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments