From 5ce48060178ec14a4b5dca481edf38017df72b0b Mon Sep 17 00:00:00 2001 From: mazze Date: Tue, 27 Mar 2007 18:04:12 +0000 Subject: [PATCH] CD into script's directory. Otherwise starting a script by double clicking at icon doesn't work. git-svn-id: https://svn.aros.org:8080/svn/aros/trunk/AROS@25592 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/rexxc/RX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workbench/rexxc/RX.c b/workbench/rexxc/RX.c index eeda9e675..76446add9 100644 --- a/workbench/rexxc/RX.c +++ b/workbench/rexxc/RX.c @@ -24,6 +24,7 @@ static struct RexxMsg *msg = NULL; static struct MsgPort *rexxport = NULL, *replyport = NULL; static BPTR out; static BOOL closestdout = FALSE; +static BPTR olddir = (BPTR)-1; static BOOL init(void) { @@ -76,6 +77,8 @@ void cleanup(void) DeleteRexxMsg(msg); if (replyport) DeletePort(replyport); + if (olddir != (BPTR)-1) + CurrentDir(olddir); } int main(int argc, char **argv) @@ -106,7 +109,8 @@ int main(int argc, char **argv) cleanup(); return RC_ERROR; } - + + olddir = CurrentDir(startup->sm_ArgList[1].wa_Lock); out = msg->rm_Stdout = Open("CON:////RX Output/CLOSE/WAIT/AUTO", MODE_READWRITE); closestdout = TRUE; -- 2.11.4.GIT