fix: filter newline (#2526)

This commit is contained in:
valoq authored and GitHub committed 2026-04-28 07:40:10 +02:00
1 parent ffe1ac1cb8
commit 54bcbca6ce
4 files changed
+39 -3

No files matched your search

+4
View File
@@ -183,6 +183,10 @@ func saveFiles(clipboard clipboard) error {
}
for _, path := range clipboard.paths {
if strings.ContainsAny(path, "\n\r") {
log.Printf("clipboard: skipping path with newline: %q", path)
continue
}
if _, err := fmt.Fprintln(files, path); err != nil {
return fmt.Errorf("write path to file: %w", err)
}