From 3131ce52a76f2d3a6f27e155401ca121cdebd88c Mon Sep 17 00:00:00 2001 From: nyne Date: Tue, 22 Apr 2025 20:29:18 +0800 Subject: [PATCH] Fix file name sanitising to remove trailing dots. Close #322 --- lib/utils/io.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/io.dart b/lib/utils/io.dart index 3746c97..d789d4b 100644 --- a/lib/utils/io.dart +++ b/lib/utils/io.dart @@ -132,7 +132,7 @@ extension DirectoryExtension on Directory { /// Sanitize the file name. Remove invalid characters and trim the file name. String sanitizeFileName(String fileName, {String? dir, int? maxLength}) { - if (fileName.endsWith('.')) { + while (fileName.endsWith('.')) { fileName = fileName.substring(0, fileName.length - 1); } var length = maxLength ?? 255;