Changeset 3db78b89


Ignore:
Timestamp:
Jan 24, 2024, 12:11:48 PM (11 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
64c4b4d
Parents:
8a33777
Message:

Fix string reading bug: Manipulator ignore should not write to its output argument.

The prior test expectation was wrong.
The test was not following its rule that it should expect
the CFA library to show scanf-analogous behaviour.

Note, the corresponding expectation in collections/string-istream-manip was already correct.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r8a33777 r3db78b89  
    10761076                        } // if
    10771077                        // FIX ME: CFA strings need to be modified to NOT change the argument for this case, then this can be removed.
    1078                         if ( rwd > 0 && args == 0 ) f.s[0]= '\0';       // read failed => no pattern match => set string to null
     1078                        if ( ! f.flags.ignore && rwd > 0 && args == 0 ) f.s[0]= '\0';   // read failed => no pattern match => set string to null
    10791079                } else {
    10801080                        if ( f.flags.delimiter ) {                                      // getline
     
    11141114                                } // if
    11151115                        } // if
    1116                         if ( rwd > 0 && args == 0 ) f.s[0]= '\0';       // read failed => no pattern match => set string to null
     1116                        if ( ! f.flags.ignore && rwd > 0 && args == 0 ) f.s[0]= '\0';   // read failed => no pattern match => set string to null
    11171117                } // if
    11181118                if ( args == 1 && eof( is ) ) {                                 // data but scan ended at EOF
  • tests/io/.expect/manipulatorsInput.arm64.txt

    r8a33777 r3db78b89  
    32323 abcxxx
    33334 aaaaaaaa
    34 5
     345 aaaaaaaa
    35356 aabbccbb
    36367 dddwww
    37 8
    38 9
     378 dddwww
     389 dddwww
    393910 aaaaaaaa
    404011 wwwwwwww
    41 12
    42 13
     4112 wwwwwwww
     4213 wwwwwwww
    434314
    444415
  • tests/io/.expect/manipulatorsInput.x64.txt

    r8a33777 r3db78b89  
    32323 abcxxx
    33334 aaaaaaaa
    34 5
     345 aaaaaaaa
    35356 aabbccbb
    36367 dddwww
    37 8
    38 9
     378 dddwww
     389 dddwww
    393910 aaaaaaaa
    404011 wwwwwwww
    41 12
    42 13
     4112 wwwwwwww
     4213 wwwwwwww
    434314
    444415
  • tests/io/.expect/manipulatorsInput.x86.txt

    r8a33777 r3db78b89  
    32323 abcxxx
    33334 aaaaaaaa
    34 5
     345 aaaaaaaa
    35356 aabbccbb
    36367 dddwww
    37 8
    38 9
     378 dddwww
     389 dddwww
    393910 aaaaaaaa
    404011 wwwwwwww
    41 12
    42 13
     4112 wwwwwwww
     4213 wwwwwwww
    434314
    444415
Note: See TracChangeset for help on using the changeset viewer.