diff --git a/docs/source/cli.rst b/docs/source/cli.rst index 6b8350ae..1edd973f 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -98,6 +98,11 @@ Environment Variables If :envvar:`XDG_CONFIG_HOME` is not set, lnav will use this directory to store its configuration in a sub-directory named :file:`.lnav`. +.. envvar:: APPDATA + + On Windows, lnav will use this directory instead of HOME + to store its configuration in a sub-directory named :file:`.lnav`. + .. envvar:: TZ The timezone setting is used in some log formats to convert UTC timestamps diff --git a/src/base/paths.cc b/src/base/paths.cc index f698f4e8..1543f214 100644 --- a/src/base/paths.cc +++ b/src/base/paths.cc @@ -37,7 +37,11 @@ namespace paths { ghc::filesystem::path dotlnav() { +#ifdef __CYGWIN__ + auto home_env = getenv("APPDATA"); +#else auto home_env = getenv("HOME"); +#endif auto xdg_config_home = getenv("XDG_CONFIG_HOME"); if (home_env != nullptr) { diff --git a/src/lnav.cc b/src/lnav.cc index 82d39768..4cc3c845 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -32,6 +32,10 @@ * a bit. */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include diff --git a/src/shlex.cc b/src/shlex.cc index 481af4a8..211ff501 100644 --- a/src/shlex.cc +++ b/src/shlex.cc @@ -29,6 +29,10 @@ * @file shlex.cc */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include "shlex.hh" diff --git a/src/string-extension-functions.cc b/src/string-extension-functions.cc index 61fc515e..789af9b5 100644 --- a/src/string-extension-functions.cc +++ b/src/string-extension-functions.cc @@ -7,6 +7,10 @@ * commercial or non-commercial, and by any means. */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include diff --git a/src/tools/bin2c.c b/src/tools/bin2c.c index a707f185..bfffcc3b 100644 --- a/src/tools/bin2c.c +++ b/src/tools/bin2c.c @@ -7,6 +7,10 @@ // whatever you want with this stuff. If we meet some day, and you think this stuff is // worth it, you can buy me a beer in return. Sandro Sigala +#ifdef __CYGWIN__ +#include +#endif + #include #include #include diff --git a/src/view_curses.cc b/src/view_curses.cc index f27416c1..d344a96a 100644 --- a/src/view_curses.cc +++ b/src/view_curses.cc @@ -29,6 +29,10 @@ * @file view_curses.cc */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include diff --git a/src/yajlpp/json_ptr.cc b/src/yajlpp/json_ptr.cc index 4099e757..82e45779 100644 --- a/src/yajlpp/json_ptr.cc +++ b/src/yajlpp/json_ptr.cc @@ -29,6 +29,10 @@ * @file json_ptr.cc */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include "yajl/api/yajl_gen.h" diff --git a/test/drive_data_scanner.cc b/test/drive_data_scanner.cc index d2341612..6377dce3 100644 --- a/test/drive_data_scanner.cc +++ b/test/drive_data_scanner.cc @@ -27,6 +27,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __CYGWIN__ +#include +#endif + #include "config.h" #include