Skip to content

bug: Parse function removes needed backslashes #38

Open
@jftuga

Description

@jftuga

In Windows, backslashes are used at the OS path separator. When I run this code, I get an incorrect result for the value of cmd:

func main() {
	sh := `upx c:\github.com\jftuga\test\test.exe`
	cmd, err := shellwords.Parse(sh)
	if err != nil {
		fmt.Println("err:", err)
		return
	}
	fmt.Println(cmd)
}

This outputs:

[upx c:github.comjftugatesttest.exe]

when it should output:

[upx c:\github.com\jftuga\test\test.exe]

Can this be fixed, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions