Use document.ReadFile to read #+SETUPFILE

Now that we allow providing a custom ReadFile implementation we should use it
everywhere we read files.
This commit is contained in:
Niklas Fasching 2019-10-08 22:25:35 +02:00
parent 9de65240a0
commit 2afd11581c

View file

@ -2,7 +2,6 @@ package org
import (
"bytes"
"io/ioutil"
"path/filepath"
"regexp"
"strings"
@ -143,7 +142,7 @@ func (d *Document) loadSetupFile(k Keyword) (int, Node) {
if !filepath.IsAbs(path) {
path = filepath.Join(filepath.Dir(d.Path), path)
}
bs, err := ioutil.ReadFile(path)
bs, err := d.ReadFile(path)
if err != nil {
d.Log.Printf("Bad setup file: %#v: %s", k, err)
return 1, k