diff --git a/src/FileSystem-Core/FileReference.class.st b/src/FileSystem-Core/FileReference.class.st index aeb64780ac3..1a557cac480 100644 --- a/src/FileSystem-Core/FileReference.class.st +++ b/src/FileSystem-Core/FileReference.class.st @@ -366,7 +366,8 @@ FileReference >> nextVersion [ parent := self parent. nameWithoutExtension := self basename copyUpTo: $.. - versionNumbers := parent children + "Check for filenames with the assumption it consists at least of basename and a single dot" + versionNumbers := (parent childrenMatching: nameWithoutExtension, '.*') select: [ :f| (f basename beginsWith: nameWithoutExtension) ] thenCollect: [ :f|