Merge #9709 'fileio: use os_copy to create backups'

ref #8288
This commit is contained in:
Justin M. Keyes
2019-05-20 22:33:19 +02:00
6 changed files with 68 additions and 111 deletions

View File

@@ -161,8 +161,7 @@ end
--@returns String with whitespace removed from its beginning and end
local function trim(s)
assert(type(s) == 'string', 'Only strings can be trimmed')
local result = s:gsub('^%s+', ''):gsub('%s+$', '')
return result
return s:match('^%s*(.*%S)') or ''
end
local function __index(t, key)