2
2
réplica de https://github.com/Hilbis/Hilbish sincronizado 2025-07-18 16:52:02 +00:00

fix: trim spaces in cd func

Este cometimento está contido em:
TorchedSammy 2021-03-31 13:46:49 -04:00
ascendente 204d50d73c
cometimento b1f2a36639

Ver ficheiro

@ -2,6 +2,7 @@ package fs
import (
"os"
"strings"
"github.com/yuin/gopher-lua"
)
@ -26,7 +27,7 @@ var exports = map[string]lua.LGFunction{
func cd(L *lua.LState) int {
path := L.ToString(1)
err := os.Chdir(path)
err := os.Chdir(strings.TrimSpace(path))
if err != nil {
switch err.(*os.PathError).Err.Error() {
case "no such file or directory":