# Lstlisting does not break on long line containing only “*”

When using the lstlisting environment, I can't get it to break on a long line which contains only the * character. This is my minimum working example. It produces a listing in which the text flows out of the listing's frame and does not produce correct line breaks. How do I fix this? I have tried different parameters in \lstset, but nothing seems to work. How do I tell the listing environment that it's okay to break on a *?

\usepackage{listings}
\begin{document}
\lstset{%
breaklines=true,
breakatwhitespace=false,
postbreak=\space,
tabsize=2,
basicstyle=\ttfamily\footnotesize,
showspaces=false,
showstringspaces=false,
extendedchars=true,
frame=single,
frameround=ffff,
aboveskip=1.5em
}
\begin{lstlisting}
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** hello world
\end{lstlisting}
\end{document}


The way text is broken in listings environment depends on the selected source code language. If you don't want to change the language setting, you can add the option literate={*}{*\allowbreak}1 which replaces each * character by a version that allows a linebreak right after it.

Updated example:

\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{%
breaklines=true,
breakatwhitespace=false,
postbreak=\space,
tabsize=2,
basicstyle=\ttfamily\footnotesize,
showspaces=false,
showstringspaces=false,
extendedchars=true,
frame=single,
frameround=ffff,
aboveskip=1.5em,