mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-05 06:30:28 +09:00
backup: Lock the buffer lines in Backup()
This commit is contained in:
@@ -82,6 +82,9 @@ func (b *Buffer) Backup() error {
|
||||
name := filepath.Join(backupdir, util.EscapePath(b.AbsPath))
|
||||
|
||||
err = overwriteFile(name, encoding.Nop, func(file io.Writer) (e error) {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
|
||||
if len(b.lines) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user