From 2f30d4cbc0ed69403856fed014449a3cc3abbe4d Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 30 May 2023 15:28:18 +0900 Subject: [PATCH] =?UTF-8?q?args=EA=B0=80=20=EB=B9=88=20=EA=B0=92=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=93=A4=EC=96=B4=EC=99=94=EC=9D=84=20=EB=95=8C=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/operation.go b/client/operation.go index 137ad9c..94dd5dc 100644 --- a/client/operation.go +++ b/client/operation.go @@ -168,6 +168,9 @@ func prepareProcessLaunch(req *shared.StartProcessRequest) *procmeta { re := regexp.MustCompile(`[^\s"']+|"([^"]*)"|'([^']*)`) args := re.FindAllString(req.Args, -1) + if len(args) == 0 { + return nil + } verpath := path.Join(req.Name, req.Version) fi, err := os.Stat(verpath) @@ -315,6 +318,8 @@ func (hc *houstonClient) launch(meta *procmeta) error { return err } +var errPrepareprocessLaunchFailed = errors.New("prepareProcessLaunch failed") + func (hc *houstonClient) startChildProcess(req *shared.StartProcessRequest) error { logger.Println("startChildProcess :", *req) if req.Version == "latest" { @@ -328,6 +333,9 @@ func (hc *houstonClient) startChildProcess(req *shared.StartProcessRequest) erro } meta := prepareProcessLaunch(req) + if meta == nil { + return errPrepareprocessLaunchFailed + } if err := hc.launch(meta); err != nil { return err }