From 277c07665110959e13bf16f75b6dd0280e580769 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 6 Nov 2021 14:28:27 +0100 Subject: [PATCH] Rename file.get_extension to file.split_extension --- file.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/file.lua b/file.lua index d7a6308..b96b4ab 100644 --- a/file.lua +++ b/file.lua @@ -9,9 +9,11 @@ function get_name(filepath) assert(#modlib.dir_delim == 1) return filepath:match(modlib.dir_delim .. "?(.-)$") end -function get_extension(filename) - return filename:match"(.*)%.(.*)$" +function split_extension(filename) + return filename:match"^(.*)%.(.*)$" end +--! deprecated +get_extension = split_extension function read(filename) local file = io.open(filename, "r")