diff options
-rw-r--r-- | intern/ghost/intern/GHOST_SystemPathsUnix.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp index fdfde13b915..86f3a0a31fb 100644 --- a/intern/ghost/intern/GHOST_SystemPathsUnix.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsUnix.cpp @@ -142,7 +142,8 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDi } static string path = ""; - string command = string("xdg-user-dir ") + type_str; + /* Pipe stderr to /dev/null to avoid error prints. We will fail gracefully still. */ + string command = string("xdg-user-dir ") + type_str + " 2> /dev/null"; FILE *fstream = popen(command.c_str(), "r"); if (fstream == NULL) { @@ -163,7 +164,7 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDi } path = path_stream.str(); - return (const GHOST_TUns8 *)path.c_str(); + return path[0] ? (const GHOST_TUns8 *)path.c_str() : NULL; } const GHOST_TUns8 *GHOST_SystemPathsUnix::getBinaryDir() const |