+2016-01-14 Brian Burg <bburg@apple.com>
+
+ prepare-changelog does not read paths containing spaces properly
+ https://bugs.webkit.org/show_bug.cgi?id=137982
+
+ Reviewed by Joseph Pecoraro.
+
+ Escape whitespace in filenames before passing the file path to other functions.
+
+ * Scripts/prepare-ChangeLog:
+ (generateFunctionLists): Use the more explicit 3-argument form of 'open'.
+
2016-01-14 Jason Marcell <jmarcell@apple.com>
Standardize the usage of "branch" vs. "branchName".
print STDERR " Extracting affected function names from source files.\n";
my %filesToExamine = map { $_ => 1 } (keys(%line_ranges_before_changed), keys(%line_ranges_after_changed));
foreach my $file (keys %filesToExamine) {
+ # Escape whitespace in filenames rather than adding quotes, since many functions can open files
+ # and other code doesn't expect to see a trailing " character when sniffing a file extension.
+ chomp $file;
+ $file =~ s/ /\\ /g;
my %saw_function;
# Find all the functions in the file.
if ($line_ranges_after_changed{$file}) {
- open SOURCE, $file or next;
+ open(SOURCE, "<", $file) or next;
my @function_ranges = get_function_line_ranges(\*SOURCE, $file);
close SOURCE;