mirror of
https://github.com/postgres/postgres.git
synced 2025-05-20 05:13:53 +03:00
Fix pgindent --show-diff option.
At least on my machine, the initial coding of this didn't actually work, because interpolation of "$post_fh->filename" doesn't act as intended. I threw in some double quotes too, just in case anybody tries to run this in a path containing spaces.
This commit is contained in:
parent
3cece34be8
commit
62e1e28bf7
@ -299,12 +299,13 @@ sub show_diff
|
|||||||
my $source_filename = shift;
|
my $source_filename = shift;
|
||||||
|
|
||||||
my $post_fh = new File::Temp(TEMPLATE => "pgdiffXXXXX");
|
my $post_fh = new File::Temp(TEMPLATE => "pgdiffXXXXX");
|
||||||
|
my $post_fh_filename = $post_fh->filename;
|
||||||
|
|
||||||
print $post_fh $indented;
|
print $post_fh $indented;
|
||||||
|
|
||||||
$post_fh->close();
|
$post_fh->close();
|
||||||
|
|
||||||
my $diff = `diff -upd $source_filename $post_fh->filename 2>&1`;
|
my $diff = `diff -upd "$source_filename" "$post_fh_filename" 2>&1`;
|
||||||
return $diff;
|
return $diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user