rhbz#1017379 do not remove too much from the path

Change-Id: Ibffa7f2fbe91be9b95217ce36999e286ef444a37
(cherry picked from commit 5b35f21f1c69239d0605b0751bed87a410fbffee)
Reviewed-on: https://gerrit.libreoffice.org/7896
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>