Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ internal actual suspend fun executeCommand(
}

val shell = when (platformProvider.osInfo().family) {
OsFamily.Windows -> "cmd.exe"
else -> "sh"
OsFamily.Windows -> "C:\\\\Windows\\\\System32\\\\cmd.exe"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why are these backslashes double escaped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancelling in favor of #1593. I don't think they should be double escaped.

else -> "/bin/sh"
}

val shellArg = when (platformProvider.osInfo().family) {
OsFamily.Windows -> "/C"
else -> "-c"
}

val argv = memScoped { (arrayOf(shell, shellArg, command).map { it.cstr.ptr } + null).toCValues() }
execvp(shell, argv)
memScoped {
val argv = (arrayOf(shell, shellArg, command).map { it.cstr.ptr } + null).toCValues()
execvp(shell, argv)
}
_exit(127) // If exec fails
}

Expand Down
Loading