From 0c6052f04184f8f3f22c02179bea9898b6fe8adb Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Mon, 9 Jan 2023 18:48:01 +0000 Subject: [PATCH] Modify generate errors script Modify generate_errors.pl such that it can now handle opening files where the file path includes a directory name containing spaces. Raised in issue #6879. Fix provided by @tom-cosgrove-arm in aforementioned issue. Signed-off-by: Thomas Daubney --- scripts/generate_errors.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate_errors.pl b/scripts/generate_errors.pl index 65383fa3cca2..e950bc5fb671 100755 --- a/scripts/generate_errors.pl +++ b/scripts/generate_errors.pl @@ -60,11 +60,11 @@ my $error_format = ; close(FORMAT_FILE); -my @files = <$include_dir/*.h>; +my @files = glob qq("$include_dir/*.h"); my @necessary_include_files; my @matches; foreach my $file (@files) { - open(FILE, "$file"); + open(FILE, '<:crlf', $file) or die("$0: $file: $!"); my $content = ; close FILE; my $found = 0;