Skip to content

Commit

Permalink
Handle CRLF in locale files.
Browse files Browse the repository at this point in the history
Previously, LF was expected, so CR (if present) would be in every message.
  • Loading branch information
orbitalquark committed Oct 1, 2020
1 parent 8609bbb commit 56511dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/locale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for line in f:lines() do
-- Any line that starts with a non-word character except '[' is considered a
-- comment.
if not line:find('^%s*[^%w_%[]') then
local id, str = line:match('^(.-)%s*=%s*(.+)$')
local id, str = line:match('^(.-)%s*=%s*(.-)\r?$')
if id and str and assert(not M[id], 'duplicate locale key "%s"', id) then
M[id] = not CURSES and str or str:gsub('_', '')
end
Expand Down

0 comments on commit 56511dc

Please sign in to comment.