fix(config): avoid doubling slug in default_filename for single-problem mode

Problem: Kattis single-problem mode sets both `contest_id` and
`problem_id` to the same slug, causing `default_filename` to
concatenate them (e.g. `addtwonumbersaddtwonumbers.cc`).

Solution: only concatenate when `problem_id ~= contest_id`; otherwise
return just `problem_id` (or `contest_id` if nil).
This commit is contained in:
Barrett Ruth 2026-03-07 02:32:52 -05:00
parent cf175a80c1
commit 4f307e323d
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -605,10 +605,10 @@ end
---@param problem_id? string
---@return string
local function default_filename(contest_id, problem_id)
if problem_id then
if problem_id and problem_id ~= contest_id then
return (contest_id .. problem_id):lower()
end
return contest_id:lower()
return (problem_id or contest_id):lower()
end
M.default_filename = default_filename