From 63d3e517349a6c4774a3f75f2fa039c780eaf5f9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 10 Apr 2016 12:36:43 +0200 Subject: longnames: use symbolic constants instead of naked ints --- internal/fusefrontend/fs_dir.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/fusefrontend') diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index ebf7015..bcb93af 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -207,21 +207,22 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f if fs.args.LongNames { isLong := nametransform.IsLongName(cName) - if isLong == 1 { + if isLong == nametransform.LongNameContent { cNameLong, err := nametransform.ReadLongName(filepath.Join(cDirAbsPath, cName)) if err != nil { toggledlog.Warn.Printf("Could not read long name for file %s, skipping file", cName) continue } cName = cNameLong - } else if isLong == 2 { + } else if isLong == nametransform.LongNameFilename { // ignore "gocryptfs.longname.*.name" continue } } name, err := fs.nameTransform.DecryptName(cName, cachedIV) if err != nil { - toggledlog.Warn.Printf("Skipping invalid name '%s' in dir '%s': %s", cName, cDirName, err) + toggledlog.Warn.Printf("Skipping invalid name '%s' in dir '%s': %s", + cName, cDirName, err) continue } -- cgit v1.2.3