From 8e74d2d8938e15129cb10959a9383cce92de6aab 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 903864bf..aee4a508 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); -- 2.39.5