diff options
| author | Bas Couwenberg <sebastic@xs4all.nl> | 2020-02-18 08:11:02 +0100 |
|---|---|---|
| committer | Bas Couwenberg <sebastic@xs4all.nl> | 2020-02-18 08:11:02 +0100 |
| commit | eea42eaae678541a5a3313ad0dbe79bd0f2d687a (patch) | |
| tree | a33d055009498d8a190b1a15110dd8f0b9aa7d85 /src/filemanager.cpp | |
| parent | 8896b2a26c89decffc3854d2b314776c85ca88d6 (diff) | |
| download | PROJ-eea42eaae678541a5a3313ad0dbe79bd0f2d687a.tar.gz PROJ-eea42eaae678541a5a3313ad0dbe79bd0f2d687a.zip | |
Don't assume $HOME to be writable.
The read_grid_from_user_writable_directory test fails otherwise.
Fixes: #1933
Diffstat (limited to 'src/filemanager.cpp')
| -rw-r--r-- | src/filemanager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filemanager.cpp b/src/filemanager.cpp index a90af572..165a5b15 100644 --- a/src/filemanager.cpp +++ b/src/filemanager.cpp @@ -1220,7 +1220,7 @@ std::string pj_context_get_user_writable_directory(PJ_CONTEXT *ctx, path = xdg_data_home; } else { const char *home = getenv("HOME"); - if (home) { + if (home && access(home, W_OK) == 0) { #if defined(__MACH__) && defined(__APPLE__) path = std::string(home) + "/Library/Application Support"; #else |
