Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Nov 15, 2023
1 parent 90a2f44 commit 91f0661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/std/src/fs/Path.ri
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public struct Path {
/// Files that end with `.`, or that start with `.` and have no other `.` in their
/// name, are considered to have no extension.
public func extension(path: string) -> string {
filename := Self.base_name(path);
filename := Self.file_name(path);
index := filename.last_index_of_byte(b'.') ?? return "";
return if index == 0 or index + 1 >= filename.len {
""
Expand Down

0 comments on commit 91f0661

Please sign in to comment.