From 9e2fb4ea81f35d16a3a6616dee82f2fa9b608c1b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 17 Oct 2012 00:54:46 +0000
Subject: hyperref (16oct12)

git-svn-id: svn://tug.org/texlive/trunk@27987 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/hyperref/hyperref.sty | 55 ++++++++++++++++-------
 1 file changed, 40 insertions(+), 15 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/hyperref/hyperref.sty')

diff --git a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
index 2b463313eb7..423453249a9 100644
--- a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
+++ b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
@@ -30,7 +30,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesPackage{hyperref}
-  [2012/10/13 v6.83j %
+  [2012/10/15 v6.83k %
   Hypertext links for LaTeX]
 \begingroup
   \@makeother\`%
@@ -4163,17 +4163,35 @@
 \DeclareLocalOptions{%
   a4paper,a5paper,b5paper,letterpaper,legalpaper,executivepaper%
 }
-\@ifpackageloaded{tex4ht}{%
-  \@ifpackagewith{hyperref}{tex4ht}{%
-  }{%
-    \PassOptionsToPackage{tex4ht}{hyperref}%
-  }%
-}{}
-\ltx@IfUndefined{HCode}{%
+\@ifpackagewith{hyperref}{tex4ht}{%
 }{%
-  \@ifpackagewith{hyperref}{tex4ht}{%
-  }{%
+  \@ifpackageloaded{tex4ht}{%
     \PassOptionsToPackage{tex4ht}{hyperref}%
+  }{%
+    \ltx@IfUndefined{HCode}{%
+    }{%
+      \begingroup
+        \def\Hy@pkg{tex4ht}%
+        \def\Hy@temp@A#1\RequirePackage[#2]#3#4\Hy@NIL{%
+          \def\Hy@param{#2#3}%
+          \ifx\Hy@param\ltx@empty
+            \expandafter\ltx@gobble
+          \else
+            \def\Hy@param{#3}%
+            \ifx\Hy@param\Hy@pkg
+              \PassOptionsToPackage{#2}{tex4ht}%
+              \expandafter\expandafter\expandafter\@gobble
+            \else
+              \expandafter\expandafter\expandafter\ltx@firstofone
+            \fi
+          \fi
+          {\Hy@temp@A#4\Hy@NIL}%
+        }%
+        \expandafter
+        \Hy@temp@A\@documentclasshook\RequirePackage[]{}\Hy@NIL
+      \endgroup
+      \PassOptionsToPackage{tex4ht}{hyperref}%
+    }%
   }%
 }
 \let\ReadBookmarks\relax
@@ -5041,17 +5059,24 @@
       \protected@edef\Hy@tempa{#2}%
       \edef\Hy@tempb{#3}%
       \ifx\Hy@tempa\ltx@empty
-        \toks@{%
-          \endgroup
-          \hyper@link{#1}%
-        }%
+        \ifx\Hy@tempb\ltx@empty
+          \Hy@Warning{Suppressing link with empty target}%
+          \toks@{%
+            \endgroup
+            \ltx@secondoftwo
+          }%
+        \else
+          \toks@{%
+            \endgroup
+            \hyper@link{#1}%
+          }%
+        \fi
       \else
         \toks@{%
           \endgroup
           \expandafter\hyper@readexternallink#2\\{#1}%
         }%
       \fi
-      \Hy@safe@activestrue
       \Hy@safe@activesfalse
       \toks@\expandafter{%
         \the\expandafter\toks@
-- 
cgit v1.2.3

