diff --git a/internal/config/config.go b/internal/config/config.go index 35254b3..a9e583f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -15,6 +15,7 @@ import ( "sort" "strconv" "strings" + "syscall" "time" "git.eeqj.de/sneak/smartconfig" @@ -779,10 +780,12 @@ func loadConfigFile(log *slog.Logger, appName string) (*smartconfig.Config, erro for _, path := range configPaths { cleanPath := filepath.Clean(path) - // Only a config file that does not exist is skipped. One that - // cannot be read or does not parse is a fatal startup error. + // Only a config file that does not exist is skipped, including + // one whose path runs through a file, such as under a HOME of + // /dev/null. One that cannot be read or does not parse is a + // fatal startup error. _, statErr := os.Stat(cleanPath) - if errors.Is(statErr, fs.ErrNotExist) { + if errors.Is(statErr, fs.ErrNotExist) || errors.Is(statErr, syscall.ENOTDIR) { continue }