Skip to content

Commit 7403820

Browse files
committed
Fix: pty_linux lookpath error
1 parent e795e4a commit 7403820

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*.out
1515
pty
1616
pty.exe
17+
mcsm.ico
18+
pty.rc
19+
pty.syso
1720
# Dependency directories (remove the comment below to include it)
1821
# vendor/
1922
cache/

console/console.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ type console struct {
3434

3535
// start pty subroutine
3636
func (c *console) Start(dir string, command []string) error {
37-
cmd, err := c.buildCmd(command)
38-
if err != nil {
39-
return err
40-
}
41-
if dir, err = filepath.Abs(dir); err != nil {
37+
if dir, err := filepath.Abs(dir); err != nil {
4238
return err
4339
} else if err := os.Chdir(dir); err != nil {
4440
return err
4541
}
42+
cmd, err := c.buildCmd(command)
43+
if err != nil {
44+
return err
45+
}
4646
c.cmd = cmd
4747
cmd.Dir = dir
4848
cmd.Env = c.env

0 commit comments

Comments
 (0)