...SplitN, not SplitAfterN
This commit is contained in:
parent
cf67bec392
commit
008ed531a2
@ -16,8 +16,8 @@ func envListToMap(envs []string) (envMap map[string]string) {
|
|||||||
envMap = make(map[string]string, 0)
|
envMap = make(map[string]string, 0)
|
||||||
|
|
||||||
for _, ev := range envs {
|
for _, ev := range envs {
|
||||||
kv = strings.SplitAfterN(ev, "=", 2)
|
kv = strings.SplitN(ev, "=", 2)
|
||||||
// I *think* SplitAfterN does this for me, but...
|
// I *think* SplitN does this for me, but...
|
||||||
if len(kv) == 1 {
|
if len(kv) == 1 {
|
||||||
kv = append(kv, "")
|
kv = append(kv, "")
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func ExpandHome(path *string) (err error) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// K but do it smarter.
|
// K but do it smarter.
|
||||||
unameSplit = strings.SplitAfterN(*path, string(os.PathSeparator), 2)
|
unameSplit = strings.SplitN(*path, string(os.PathSeparator), 2)
|
||||||
if len(unameSplit) != 2 {
|
if len(unameSplit) != 2 {
|
||||||
unameSplit = append(unameSplit, "")
|
unameSplit = append(unameSplit, "")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user