From 91d1efffa50fede28f99dedff3cbcdb1e7c57495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 18 Mar 2004 08:21:54 +0000 Subject: [PATCH] Only changes current dir when a destination folder is provided and don't exit when no destination is provided git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7020 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/expander/ExpanderThread.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/apps/expander/ExpanderThread.cpp b/src/apps/expander/ExpanderThread.cpp index ab0462f5d7..87a6db0cc1 100644 --- a/src/apps/expander/ExpanderThread.cpp +++ b/src/apps/expander/ExpanderThread.cpp @@ -66,8 +66,10 @@ ExpanderThread::ThreadStartup() if ((status = GetDataStore()->FindRef("srcRef", &srcRef))!=B_OK) return status; - if ((status = GetDataStore()->FindRef("destRef", &destRef))!=B_OK) - return status; + if ((status = GetDataStore()->FindRef("destRef", &destRef))==B_OK) { + BPath path(&destRef); + chdir(path.Path()); + } if ((status = GetDataStore()->FindString("cmd", &cmd))!=B_OK) return status; @@ -78,10 +80,7 @@ ExpanderThread::ThreadStartup() pathString.Append("\""); cmd.ReplaceAll("%s", pathString.String()); - path.SetTo(&destRef); - chdir(path.Path()); - - int32 argc = 3; + int32 argc = 3; const char ** argv = new const char * [argc + 1]; argv[0] = strdup("/bin/sh");