REBOL [
	System: "REBOL [R3] Language Interpreter and Run-time Environment"
	Title: "REBOL 3 Mezzanine: Control"
	Rights: {
		Copyright 2012 REBOL Technologies
		REBOL is a trademark of REBOL Technologies
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
]

launch: func [
	{Runs a script as a separate process; return immediately.}
	script [file! string! none!] "The name of the script"
	/args arg [string! block! none!] "Arguments to the script"
	/wait "Wait for the process to terminate"
	/local exe
][
	if file? script [script: to-local-file clean-path script]
	exe: to-local-file system/options/boot

	; Quote everything, just in case it has spaces:
	args: to-string reduce [{"} exe {" "} script {" }]
	if arg [append args arg]
	either wait [call/wait args] [call args]
]

REBOL [
	System: "REBOL [R3] Language Interpreter and Run-time Environment"
	Title: "REBOL 3 Mezzanine: Control"
	Rights: {
		Copyright 2012 REBOL Technologies
		REBOL is a trademark of REBOL Technologies
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
]

launch: func [
	{Runs a script as a separate process; return immediately.}
	script [file! string! none!] "The name of the script"
	/args arg [string! block! none!] "Arguments to the script"
	/wait "Wait for the process to terminate"
][
	if file? script [script: to-local-file clean-path script]
	args: reduce [to-local-file system/options/boot script]
	if arg [append args arg]
	either wait [call/wait args] [call args]
]

Fix LAUNCH to properly work with argv-based CALL
Fix LAUNCH to properly work with argv-based CALL

The more comprehensive implementation of CALL switched to a block-based
interface for passing multiple arguments. This broke LAUNCH, as LAUNCH
would simple concatenate interpreter and script into a single string and
pass that to CALL. This commit adapts LAUNCH to pass a block to CALL.
