Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62e1e28

Browse filesBrowse 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
Copy full SHA for 62e1e28

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎src/tools/pgindent/pgindent

Copy file name to clipboardExpand all lines: src/tools/pgindent/pgindent
+2-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.