------- Comment #5 from aldot at gcc dot gnu dot org 2005-12-27 13:15 ------- I'm bootstrapping and will test the patch below (gcc.gfortran.pr25486.0.diff). I'm uncertain on the expected results of the testcase above for -ffixed-line-length-none, so i'm not changing the behaviour for this case (i.e. no padding).
2005-12-27 PR fortran/25486 * scanner.c (load_line): use maxlen to determine the line-length used for padding lines in fixed form. Index: gcc/fortran/scanner.c =================================================================== --- gcc/fortran/scanner.c (revision 109080) +++ gcc/fortran/scanner.c (working copy) @@ -809,11 +809,13 @@ load_line (FILE * input, char **pbuf, in /* Pad lines to the selected line length in fixed form. */ if (gfc_current_form == FORM_FIXED - && gfc_option.fixed_line_length > 0 + && gfc_option.fixed_line_length != 0 && !preprocessor_flag && c != EOF) - while (i++ < gfc_option.fixed_line_length) - *buffer++ = ' '; + { + while (i++ < maxlen) + *buffer++ = ' '; + } *buffer = '\0'; *pbuflen = buflen; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25486