commit | b8bc1bf767474819792c23f32d8286a45736f1c6 | [log] [tgz] |
---|---|---|
author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | Sat Dec 03 11:45:07 2016 -0800 |
committer | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | Sat Dec 03 11:45:07 2016 -0800 |
tree | df2188ba0aefe1aa02744f21a637987b9e8218bb | |
parent | 756f7b183b7ab78acdbbee5c7f392838ed459dda [diff] |
Fix broken logic merged from #9
diff --git a/homedir.go b/homedir.go index 8996b02..47e1f9e 100644 --- a/homedir.go +++ b/homedir.go
@@ -87,8 +87,8 @@ cmd := exec.Command("getent", "passwd", strconv.Itoa(os.Getuid())) cmd.Stdout = &stdout if err := cmd.Run(); err != nil { - // If "getent" is missing, ignore it - if err == exec.ErrNotFound { + // If the error is ErrNotFound, we ignore it. Otherwise, return it. + if err != exec.ErrNotFound { return "", err } } else {