mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
haiku: Don't change the cwd on startup if launched from a Terminal.
This patch was written by @pulkomandy. Thanks! Reference Issue #7596.
This commit is contained in:
@@ -118,9 +118,13 @@ static int StartBeLooper()
|
||||
} while ((!be_app) || be_app->IsLaunching());
|
||||
}
|
||||
|
||||
/* Change working directory to that of executable */
|
||||
/* If started from the GUI, change working directory to that of executable.
|
||||
* This matches behavior on other platforms and may be needed by some SDL software.
|
||||
* Don't do it when started from terminal (TERM environment variable is set), because in that
|
||||
* case, the current directory may be important, and after this there will be no way to know
|
||||
* what it was. */
|
||||
app_info info;
|
||||
if (B_OK == be_app->GetAppInfo(&info)) {
|
||||
if (NULL == getenv("TERM") && B_OK == be_app->GetAppInfo(&info)) {
|
||||
entry_ref ref = info.ref;
|
||||
BEntry entry;
|
||||
if (B_OK == entry.SetTo(&ref)) {
|
||||
|
Reference in New Issue
Block a user