Skip to content

Commit

Permalink
Bug fix for remove config options
Browse files Browse the repository at this point in the history
  • Loading branch information
xwjdsh committed Dec 14, 2017
1 parent 9b0a6d7 commit a621b47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sshconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ func Update(path string, h *HostConfig, newAlias string) error {
connectMap[Hostname] = ""
connectMap[Port] = ""
}
// update node

// update node
for i := 0; i >= 0 && i < len(updateHost.Nodes); i++ {
switch t := updateHost.Nodes[i].(type) {
case *ssh_config.KV:
Expand All @@ -212,14 +212,14 @@ func Update(path string, h *HostConfig, newAlias string) error {
} else {
t.SetLeadingSpace(4)
t.Value = value
if _, ok := connectMap[t.Key]; ok {
connectMap[t.Key] = t.Value
} else {
h.Config[t.Key] = t.Value
}
}
delete(updateKV, t.Key)
}
if _, ok := connectMap[t.Key]; ok {
connectMap[t.Key] = t.Value
} else {
h.Config[t.Key] = t.Value
}
}
}
// append new node
Expand Down

0 comments on commit a621b47

Please # to comment.