teximg: If the log isn't written, avoid ugly error messages.
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 29 May 2008 23:29:40 +0000 (19:29 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 29 May 2008 23:29:40 +0000 (19:29 -0400)
IkiWiki/Plugin/teximg.pm
debian/changelog

index 29c1057f300d2580049218d59a876dfca526eccf..8c3e88c6974a8f2d5aa00fc119ba1f8941f4c943 100644 (file)
@@ -119,12 +119,13 @@ sub gen_image ($$$$) { #{{{
        }
        else {
                # store failure log
-               my $log;
+               my $log="";
                {
-                       open(my $f, '<', "$tmp/$digest.log");
-                       local $/=undef;
-                       $log = <$f>;
-                       close($f);
+                       if (open(my $f, '<', "$tmp/$digest.log")) {
+                               local $/=undef;
+                               $log = <$f>;
+                               close($f);
+                       }
                }
                writefile("$digest.log", "$config{destdir}/$imagedir", $log);
 
index 16c5fa65c903d9bd9fe058b67e930db1b816b457..6012bc3bffc7eb05c85d546a098068dfd0297ec1 100644 (file)
@@ -16,6 +16,7 @@ ikiwiki (2.48) UNRELEASED; urgency=low
     mailed.
   * The password_cost config setting is provided as a "more security" knob.
   * teximg: Fix logurl.
+  * teximg: If the log isn't written, avoid ugly error messages.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 28 May 2008 03:07:37 -0400