Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 62e1e28

Browse files
committed
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.
1 parent 3cece34 commit 62e1e28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/pgindent/pgindent

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,13 @@ sub show_diff
299299
my $source_filename = shift;
300300

301301
my $post_fh = new File::Temp(TEMPLATE => "pgdiffXXXXX");
302+
my $post_fh_filename = $post_fh->filename;
302303

303304
print $post_fh $indented;
304305

305306
$post_fh->close();
306307

307-
my $diff = `diff -upd $source_filename $post_fh->filename 2>&1`;
308+
my $diff = `diff -upd "$source_filename" "$post_fh_filename" 2>&1`;
308309
return $diff;
309310
}
310311

0 commit comments

Comments
 (0)