diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-01-23 13:50:49 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-01-23 13:50:49 -0500 |
commit | 62e1e28bf76910ffe47ddbc5c1fade41e1a65dac (patch) | |
tree | d620c2529cdacbdb5a618259acd168fa5423a982 /src | |
parent | 3cece34be842178a3c5697a58e03fb4a5d576378 (diff) | |
download | postgresql-62e1e28bf76910ffe47ddbc5c1fade41e1a65dac.tar.gz postgresql-62e1e28bf76910ffe47ddbc5c1fade41e1a65dac.zip |
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/tools/pgindent/pgindent | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 73caa831d0a..5eff1f8032d 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -299,12 +299,13 @@ sub show_diff my $source_filename = shift; my $post_fh = new File::Temp(TEMPLATE => "pgdiffXXXXX"); + my $post_fh_filename = $post_fh->filename; print $post_fh $indented; $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; } |