[EditLine] Rewrite GetHistoryFilePath
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 22 May 2019 17:46:59 +0000 (17:46 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 22 May 2019 17:46:59 +0000 (17:46 +0000)
commitfb9b3011953cf89f70b1c4e802396a6656dfc9b3
tree4d94869706b9680624740b426bb11d17f094a2e9
parentb417513a506f2dfbe478fa499d75e6a625a361a5
[EditLine] Rewrite GetHistoryFilePath

Rewrite the GetHistoryFilePath implementation without relying on
FileSpec in the spirit of our discussion in D61994.

It changes LLDBs behavior in two ways:

1. We now only use the -widehistory suffix when LLDB is built with wchar
   support, instead of as the fallback from when the ~/.lldb directory
   isn't writable.

2. When the ~/.lldb directory isn't writable, we don't write any history
   files at all. Previously we would write them to the user's home
   directory (with the incorrect wide suffix), polluting ~ with a
   different file for every IO handler.

Differential revision: https://reviews.llvm.org/D62216

llvm-svn: 361412
lldb/source/Host/common/Editline.cpp