From 19d35bea0d3294637f8ce9ce630f2d52378a2722 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Thu, 14 Mar 2024 12:11:12 +0100 Subject: [PATCH] Alire.Utils.Regex: initialize matches explicitly (#1637) --- src/alire/alire-utils-regex.adb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/alire/alire-utils-regex.adb b/src/alire/alire-utils-regex.adb index 903864bfc..aee4a5086 100644 --- a/src/alire/alire-utils-regex.adb +++ b/src/alire/alire-utils-regex.adb @@ -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);