X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=do.go;h=fd3bde00f75440c902a02d58e239514c00c9f701;hb=f0f007ed9bb046289965d2a7e64f215e4a50a441;hp=7d0ed516dc76fbdf6cbe1acd122db76dbc6be0e8;hpb=150988618524bf17378bd8770231cda7c9bbb43a;p=goredo.git diff --git a/do.go b/do.go index 7d0ed51..fd3bde0 100644 --- a/do.go +++ b/do.go @@ -1,6 +1,6 @@ /* -goredo -- redo implementation on pure Go -Copyright (C) 2020-2021 Sergey Matveev +goredo -- djb's redo implementation on pure Go +Copyright (C) 2020-2022 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