1h-fix-parse.pl-ctxdiff.patch
text/x-patch
Filename: 1h-fix-parse.pl-ctxdiff.patch
Type: text/x-patch
Part: 7
Message:
Re: CommitFest 2009-09, two weeks on
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/preproc/parse.pl | 8 | 1 |
diff -dcrpN pgsql.regressiontests/src/interfaces/ecpg/preproc/parse.pl pgsql.fixparsepl/src/interfaces/ecpg/preproc/parse.pl
*** pgsql.regressiontests/src/interfaces/ecpg/preproc/parse.pl 2009-10-03 01:54:56.000000000 +0200
--- pgsql.fixparsepl/src/interfaces/ecpg/preproc/parse.pl 2009-10-03 02:18:47.000000000 +0200
*************** sub include_stuff {
*** 313,318 ****
--- 313,319 ----
local($includestream, $includefilename, $includeblock, $copy, $field_count) = @_;
$copied = 0;
$inblock = 0;
+ $have_addon = 0;
$filename = $path . "/" . $includefilename;
while (($_ = &Getline2($filename),$getline_ok)) {
if ($includeblock ne '' && $Fld[1] eq 'ECPG:' && $inblock == 0) {
*************** sub include_stuff {
*** 321,329 ****
$inblock = 1;
$includetype = $Fld[3];
if ($includetype eq 'rule') {
! &dump_fields($stmt_mode, *fields, $field_count, ' { ');
}
elsif ($includetype eq 'addon') {
&add_to_buffer('rules', ' { ');
}
}
--- 322,336 ----
$inblock = 1;
$includetype = $Fld[3];
if ($includetype eq 'rule') {
! if ($have_addon == 0) {
! &dump_fields($stmt_mode, *fields, $field_count, ' { ');
! }
! else {
! &dump_fields($stmt_mode, *fields, $field_count, '');
! }
}
elsif ($includetype eq 'addon') {
+ $have_addon = 1;
&add_to_buffer('rules', ' { ');
}
}