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
This commit is contained in:
@@ -66,8 +66,10 @@ ExpanderThread::ThreadStartup()
|
|||||||
|
|
||||||
if ((status = GetDataStore()->FindRef("srcRef", &srcRef))!=B_OK)
|
if ((status = GetDataStore()->FindRef("srcRef", &srcRef))!=B_OK)
|
||||||
return status;
|
return status;
|
||||||
if ((status = GetDataStore()->FindRef("destRef", &destRef))!=B_OK)
|
if ((status = GetDataStore()->FindRef("destRef", &destRef))==B_OK) {
|
||||||
return status;
|
BPath path(&destRef);
|
||||||
|
chdir(path.Path());
|
||||||
|
}
|
||||||
if ((status = GetDataStore()->FindString("cmd", &cmd))!=B_OK)
|
if ((status = GetDataStore()->FindString("cmd", &cmd))!=B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@@ -78,10 +80,7 @@ ExpanderThread::ThreadStartup()
|
|||||||
pathString.Append("\"");
|
pathString.Append("\"");
|
||||||
cmd.ReplaceAll("%s", pathString.String());
|
cmd.ReplaceAll("%s", pathString.String());
|
||||||
|
|
||||||
path.SetTo(&destRef);
|
int32 argc = 3;
|
||||||
chdir(path.Path());
|
|
||||||
|
|
||||||
int32 argc = 3;
|
|
||||||
const char ** argv = new const char * [argc + 1];
|
const char ** argv = new const char * [argc + 1];
|
||||||
|
|
||||||
argv[0] = strdup("/bin/sh");
|
argv[0] = strdup("/bin/sh");
|
||||||
|
|||||||
Reference in New Issue
Block a user