diff --git a/cmd/verae-print/saveas.go b/cmd/verae-print/saveas.go index c753279..1feca2d 100644 --- a/cmd/verae-print/saveas.go +++ b/cmd/verae-print/saveas.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "path" "path/filepath" "strings" "time" @@ -21,7 +22,7 @@ func saveNameFromTitle(title string, now time.Time) string { for _, p := range []string{"Microsoft Word - ", "Microsoft Excel - ", "Microsoft PowerPoint - "} { t = strings.TrimPrefix(t, p) } - t = filepath.Base(strings.ReplaceAll(t, `\`, "/")) + t = path.Base(strings.ReplaceAll(t, `\`, "/")) // slash-only: "a:b" is not a drive here if ext := filepath.Ext(t); ext != "" && len(ext) <= 6 && !strings.ContainsAny(ext, " ") { t = strings.TrimSuffix(t, ext) }