From 322294b2ac1ef1b7e51e14ff8d32f2daadba47f6 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 22 Mar 2017 21:22:26 -0600 Subject: [PATCH] Normalize filenames when writing Former-commit-id: 84c13ae6f2f058709c59c3bc3cd3bce41cfc580c [formerly d0200cc718af544ea6d809207ee496b9234d76cb] [formerly 31012f0ebf56f4e7fd142b658aaa32645f743a72 [formerly 7d92efd3cd8ce550304eda03518515f57b99a376 [formerly a3d1b822e465b001568a86e925fbb6ee07012977]]] Former-commit-id: ca2c13ab6848c86deb1a7b432e564c21c29e1007 [formerly af1fd98d479fac25cef74f522d2467f9ee582132] Former-commit-id: e47d01d1ef3f59d7b4acaef5d74965d4e2e40adb Former-commit-id: 0136d5d640aef8d61d15eade442934baa6203173 --- page.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/page.go b/page.go index fabcc16..42110bb 100755 --- a/page.go +++ b/page.go @@ -23,12 +23,11 @@ type Page struct { } func Open(name string) (p *Page) { - name = strings.ToLower(name) // no case p = new(Page) p.Name = name p.Text = versionedtext.NewVersionedText("") p.Render() - bJSON, err := ioutil.ReadFile(path.Join(pathToData, encodeToBase32(name)+".json")) + bJSON, err := ioutil.ReadFile(path.Join(pathToData, encodeToBase32(strings.ToLower(name))+".json")) if err != nil { return } @@ -66,7 +65,7 @@ func (p *Page) Save() error { if err != nil { return err } - return ioutil.WriteFile(path.Join(pathToData, encodeToBase32(p.Name)+".json"), bJSON, 0755) + return ioutil.WriteFile(path.Join(pathToData, encodeToBase32(strings.ToLower(p.Name))+".json"), bJSON, 0755) } func (p *Page) Erase() error {