File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,22 @@ pub const PatchSystem = struct {
7272 is_debug_enabled : bool = false ,
7373 },
7474 ) ! void {
75- for (self .list_of_solution_file_paths .items , self .list_of_exercise_file_paths .items ) | solution , exercise | {
75+ for (self .list_of_solution_file_paths .items ) | solution | {
76+ const basename = STD .fs .path .basename (solution );
77+
78+ var matched_exercise : ? []const u8 = null ;
79+ for (self .list_of_exercise_file_paths .items ) | exercise | {
80+ if (STD .mem .eql (u8 , STD .fs .path .basename (exercise ), basename )) {
81+ matched_exercise = exercise ;
82+ break ;
83+ }
84+ }
85+
86+ const exercise = matched_exercise orelse {
87+ STD .debug .print ("No matching exercise found for {s}\n " , .{basename });
88+ continue ;
89+ };
90+
7691 const PATCH_FILE_PATH = try STD .mem .replaceOwned (
7792 u8 ,
7893 allocator ,
You can’t perform that action at this time.
0 commit comments