]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
web commit by JeremyReed: add horizontal rule to separate, reply to feedback, remove...
[ikiwiki.git] / IkiWiki.pm
index 848f1dda8079494d639dac1fd7c1748c58e187cd..18a518f3f57ba06c7fdb4942e90cd13af4a1d882 100644 (file)
@@ -774,7 +774,8 @@ sub lockwiki (;$) { #{{{
 } #}}}
 
 sub unlockwiki () { #{{{
-       return close($wikilock);
+       return close($wikilock) if $wikilock;
+       return;
 } #}}}
 
 my $commitlock;
@@ -800,7 +801,8 @@ sub disable_commit_hook () { #{{{
 } #}}}
 
 sub enable_commit_hook () { #{{{
-       return close($commitlock);
+       return close($commitlock) if $commitlock;
+       return;
 } #}}}
 
 sub loadindex () { #{{{
@@ -1017,7 +1019,9 @@ sub file_pruned ($$) { #{{{
 
 sub gettext { #{{{
        # Only use gettext in the rare cases it's needed.
-       if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) {
+       if ((exists $ENV{LANG} && length $ENV{LANG}) ||
+           (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) ||
+           (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES})) {
                if (! $gettext_obj) {
                        $gettext_obj=eval q{
                                use Locale::gettext q{textdomain};