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:
parent
cf175a80c1
commit
4f307e323d
1 changed files with 2 additions and 2 deletions
|
|
@ -605,10 +605,10 @@ end
|
||||||
---@param problem_id? string
|
---@param problem_id? string
|
||||||
---@return string
|
---@return string
|
||||||
local function default_filename(contest_id, problem_id)
|
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()
|
return (contest_id .. problem_id):lower()
|
||||||
end
|
end
|
||||||
return contest_id:lower()
|
return (problem_id or contest_id):lower()
|
||||||
end
|
end
|
||||||
M.default_filename = default_filename
|
M.default_filename = default_filename
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue