From 2cf7f9b4a6dfe7eb091c30e48f2a4b53ef701d33 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Thu, 2 Jul 2020 08:40:29 +0200
Subject: [PATCH] [ptests] silently ignore blank lines in tests configuration
 directives

---
 ptests/ptests.ml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ptests/ptests.ml b/ptests/ptests.ml
index 6b316854a46..3202933a25a 100644
--- a/ptests/ptests.ml
+++ b/ptests/ptests.ml
@@ -819,13 +819,16 @@ let scan_options dir scan_buffer default =
              r := (List.assoc name config_options) dir opt !r
            with Not_found ->
              lock_eprintf "@[unknown configuration option: %s@\n%!@]" name)
-    with Scanf.Scan_failure _ ->
+    with
+    | Scanf.Scan_failure _ ->
       if str_string_match end_comment s 0
       then raise End_of_file
       else ()
+    | End_of_file -> (* ignore blank lines. *) ()
   in
   try
     while true do
+      if Scanf.Scanning.end_of_input scan_buffer then raise End_of_file;
       Scanf.bscanf scan_buffer "%s@\n" treat_line
     done;
     assert false
-- 
GitLab