No backups for no name files

This commit is contained in:
Zachary Yedidia
2019-12-22 13:43:29 -05:00
parent c4d5d7c195
commit fc706bc404
7 changed files with 18 additions and 11 deletions

View File

@@ -204,7 +204,7 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT
b.SharedBuffer = new(SharedBuffer)
b.Type = btype
if b.Settings["backup"].(bool) {
if b.Settings["backup"].(bool) && len(path) > 0 {
backupfile := config.ConfigDir + "/backups/" + EscapePath(absPath)
if info, err := os.Stat(backupfile); err == nil {
backup, err := os.Open(backupfile)