When I input a listing with \lstinputlisting from the listings package, I get an additional vertical space, when I use this in combination with the hyperref package. As the picture shows, a certain amount of space is added to the listing.
The output is:

And the code for this is:
MWE without hyperref:
\documentclass{article}
\usepackage{filecontents}
\usepackage{listings}
%\usepackage{hyperref}
\begin{document}
\begin{filecontents*}{\jobname.temp}
Line of code
\end{filecontents*}
Without hyperref:
\fboxsep=0pt\fbox{\lstinputlisting[nolol]{\jobname.temp}}
\end{document}
MWE with hyperref:
\documentclass{article}
\usepackage{filecontents}
\usepackage{listings}
\usepackage{hyperref}
\begin{document}
\begin{filecontents*}{\jobname.temp}
Line of code
\end{filecontents*}
With hyperref:
\fboxsep=0pt\fbox{\lstinputlisting[nolol]{\jobname.temp}}
\end{document}
I played around a lot with settings and even altering the listings package code a bit, but I was'nt able to figure out how to get rid of this space. I want the same output, if hyperref is loaded or not using the same source code.

\lst@MakeCaptionbut I always got errors with a real-world example. As far as I can see now, your code runs perfectly without any error for a huge example file! Thank you very much! :-) – Thomas F. Sturm Jul 22 '13 at 15:02\special), how the hyper features can be implemented with the different drivers, ... This would fill several chapters of a book. A comment is the wrong place for this. A best way to proceed depends very much on the circumstances (one document vs. two documents, features used, TeX expertise, ...). – Heiko Oberdiek Feb 04 '17 at 21:17but have not been able to locate any manual on it, let alone the options....
The specific case I am interested is several hundred legacy manuscripts that need to be produced, with links and without them, and with a fidelity between electronic and paper.
– Paulo Ney Feb 09 '17 at 16:39