Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitb2a4c96

Browse files
authored
fix: patch config-ssh panic condition (#210)
1 parent84f8540 commitb2a4c96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎internal/cmd/configssh.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ func removeOldConfig(config string) (string, bool) {
152152
ifstartIndex==-1||endIndex==-1 {
153153
returnconfig,false
154154
}
155-
config=config[:startIndex-1]+config[endIndex+len(sshEndToken)+1:]
156-
157-
returnconfig,true
155+
ifstartIndex==0 {
156+
returnconfig[endIndex+len(sshEndToken)+1:],true
157+
}
158+
returnconfig[:startIndex-1]+config[endIndex+len(sshEndToken)+1:],true
158159
}
159160

160161
// sshAvailable returns true if SSH is available for at least one environment.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp