diff options
-rw-r--r-- | pkgtools.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgtools.go b/pkgtools.go index 350ab6a..aaffb75 100644 --- a/pkgtools.go +++ b/pkgtools.go @@ -224,7 +224,11 @@ var _ ArchiveReader = (*SlackwarePkg)(nil) func OpenSlackwarePkg(fp string) (*SlackwarePkg, error) { var pkg SlackwarePkg var err error - pkg.Format = PackageType(filepath.Ext(fp)[1:]) + + if v := filepath.Ext(fp); len(v) > 0 { + pkg.Format = PackageType(filepath.Ext(fp)[1:]) + } + pkg.file, err = os.Open(fp) if err != nil { return nil, err |