X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=do.go;h=c4a569665b51f029aa9161d2cf03238fa6ce20e0;hb=2cea0c64b5a0240bfe6746a98a5b350812edb96d;hp=360cc29b0e99fa51e306588b3e8024133a87f10d;hpb=4833ec5f8dec865fbf600a0aeab2bc64fc620f96;p=goredo.git diff --git a/do.go b/do.go index 360cc29..c4a5696 100644 --- a/do.go +++ b/do.go @@ -1,6 +1,6 @@ /* -goredo -- redo implementation on pure Go -Copyright (C) 2020 Sergey Matveev +goredo -- djb's redo implementation on pure Go +Copyright (C) 2020-2021 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ func findDo(fdDep *os.File, cwd, tgt string) (string, int, error) { doFile = strings.Join(append( []string{"default"}, append(exts, "do")..., ), ".") - if len(levels) > 0 || doFile != doFileOrig { + if len(levels) > 0 || (doFile != doFileOrig && doFile != tgt) { exists, err = existsDo(fdDep, cwd, path.Join(updir, doFile)) if err != nil { return "", 0, err @@ -72,7 +72,7 @@ func findDo(fdDep *os.File, cwd, tgt string) (string, int, error) { exts = exts[1:] } doFile = "default.do" - if len(levels) > 0 || doFile != doFileOrig { + if len(levels) > 0 || (doFile != doFileOrig && doFile != tgt) { exists, err = existsDo(fdDep, cwd, path.Join(updir, doFile)) if err != nil { return "", 0, err @@ -82,7 +82,7 @@ func findDo(fdDep *os.File, cwd, tgt string) (string, int, error) { } } levels = append(levels, "..") - dirAbs, err := filepath.Abs(updir) + dirAbs, err := filepath.Abs(path.Join(cwd, updir)) if err != nil { panic(err) }