I hope this question is not a trivial one, but I was not able to find any answer to that.
I found out that sometimes when I put an \hfill command in order to align some text to the right, there is a line break after the first word of the right-aligned text, even though there is surely enough space from the text on the left.
After playing with it a bit, it seems to me that it happens after there was a line break within a word in the paragraph.
I can't see any reason for that, but yet again I might not have a full understanding of how line breaking and \hfill work.
Here is a minimal example:
\documentclass{article}
\begin{document}
If there is a line break within a word as a result of some verymuchsuperlongword,
then the text after hfill breaks: \hfill Some words.
If there isn't a line break within a word as a result of some very much super long word,
then everything looks fine: \hfill Some words.
\end{document}
And that's how it looks:

Does anyone have any idea what might be the problem and how I can avoid it?
\hfillmakes it possible. Is the\hfillused for setting an author attribution? If you type\hfill Some~words.then there will be no additional line. However, the\hfillcould fail to push the words at the end of the line, if it comes too near the right margin. – egreg Aug 27 '14 at 21:05\hfill some~wordswouldn't help since what I actually want to put there is a citation. What does work is the solution in the link you've posted, that is: adding\linepenalty100\exhyphenpenalty0before. Thanks a lot again! – Moysh Aug 27 '14 at 21:27