Skip to content

Commit

Permalink
Alire.Utils.Regex: initialize matches explicitly (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo authored Mar 14, 2024
1 parent fd99bea commit 19d35be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/alire/alire-utils-regex.adb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ package body Alire.Utils.Regex is
end Count_Parentheses;

use GNAT.Regpat;
Matches : Match_Array (1 .. Count_Parentheses);
-- This is a safe estimation, as some '(' may not be part of a capture
Matches : Match_Array (1 .. Count_Parentheses) := (others => No_Match);
-- This is a safe estimation, as some '(' may not be part of a capture.
-- Initialization added just in case given the discussion at
-- https://forum.ada-lang.io/t/regpat-bug-or-handling-error/705/5

begin
Match (Regex, Text, Matches);
Expand Down

0 comments on commit 19d35be

Please sign in to comment.