GCC Bugzilla – Attachment 8525 Details for
Bug 20661
[4.0 only] End of record not detected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated patch
transfer.c-diff-updated (text/plain), 3.26 KB, created by
Thomas Koenig
on 2005-04-04 10:13:33 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Thomas Koenig
Created:
2005-04-04 10:13:33 UTC
Size:
3.26 KB
patch
obsolete
>*** transfer.c.orig 2005-03-31 17:30:06.000000000 +0200 >--- transfer.c 2005-04-04 12:05:49.000000000 +0200 >*************** >*** 79,84 **** >--- 79,85 ---- > > gfc_unit *current_unit = NULL; > static int sf_seen_eor = 0; >+ static int eor_condition = 0; > > char scratch[SCRATCH_SIZE] = { }; > static char *line_buffer = NULL; >*************** >*** 150,156 **** > else > p = base = data; > >! memset(base,'\0',*length); > > current_unit->bytes_left = options.default_recl; > readlen = 1; >--- 151,163 ---- > else > p = base = data; > >! /* If we have seen an eor previously, return a length of 0. The >! caller is responsible for correctly padding the input field. */ >! if (sf_seen_eor) >! { >! *length = 0; >! return base; >! } > > current_unit->bytes_left = options.default_recl; > readlen = 1; >*************** >*** 179,193 **** > > if (readlen < 1 || *q == '\n' || *q == '\r') > { >- /* ??? What is this for? */ >- if (current_unit->unit_number == options.stdin_unit) >- { >- if (n <= 0) >- continue; >- } > /* Unexpected end of line. */ > if (current_unit->flags.pad == PAD_NO) > { > generate_error (ERROR_EOR, NULL); > return NULL; > } >--- 186,197 ---- > > if (readlen < 1 || *q == '\n' || *q == '\r') > { > /* Unexpected end of line. */ > if (current_unit->flags.pad == PAD_NO) > { >+ if (advance_status == ADVANCE_NO) >+ eor_condition = 1; >+ > generate_error (ERROR_EOR, NULL); > return NULL; > } >*************** >*** 195,200 **** >--- 199,211 ---- > current_unit->bytes_left = 0; > *length = n; > sf_seen_eor = 1; >+ >+ /* If we see an EOR during non-advancing I/O with padding, >+ we need to finish the assignment first, then raise the >+ error. Set the flag accordingly. */ >+ if (advance_status == ADVANCE_NO) >+ eor_condition = 1; >+ > break; > } > >*************** >*** 204,209 **** >--- 215,223 ---- > } > while (n < *length); > >+ if (ioparm.size != NULL) >+ *ioparm.size += *length; >+ > return base; > } > >*************** >*** 434,439 **** >--- 448,458 ---- > if (type == BT_COMPLEX) > type = BT_REAL; > >+ /* If there's an EOR condition, we simulate finalizing the transfer >+ by doing nothing. */ >+ if (eor_condition) >+ return; >+ > for (;;) > { > /* If reversion has occurred and there is another real data item, >*************** >*** 1114,1119 **** >--- 1133,1139 ---- > g.first_item = 1; > g.item_count = 0; > sf_seen_eor = 0; >+ eor_condition = 0; > > pre_position (); > >*************** >*** 1229,1235 **** > length = 1; > /* sf_read has already terminated input because of an '\n' */ > if (sf_seen_eor) >! break; > > do > { >--- 1249,1258 ---- > length = 1; > /* sf_read has already terminated input because of an '\n' */ > if (sf_seen_eor) >! { >! sf_seen_eor=0; >! break; >! } > > do > { >*************** >*** 1395,1400 **** >--- 1418,1430 ---- > static void > finalize_transfer (void) > { >+ >+ if (eor_condition) >+ { >+ generate_error (ERROR_EOR, NULL); >+ return; >+ } >+ > if (ioparm.library_return != LIBRARY_OK) > return; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 20661
:
8464
| 8525