Changeset 37ceccb
- Timestamp:
- Oct 17, 2023, 12:12:00 PM (14 months ago)
- Branches:
- master
- Children:
- 5e0bba5
- Parents:
- 1b41219
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string_res.cfa
r1b41219 r37ceccb 236 236 // get bytes 237 237 try { 238 *(temp.Handle.ulink->EndVbyte) = '\0'; // pre-assign empty cstring 238 239 in | wdi( lenReadable, temp.Handle.ulink->EndVbyte ); 239 240 } catch (cstring_length*) { … … 247 248 } 248 249 249 250 if ( temp.Handle.lnth > 0 ) s = temp; 250 251 return in; 251 252 } … … 268 269 cstr[wd] = '\0'; // guard null terminate string 269 270 try { 271 cstr[0] = '\0'; // pre-assign as empty cstring 270 272 is | cf; 271 273 } catch( cstring_length * ) { 272 274 cont = true; 273 275 } finally { 274 if ( ! cf.flags.ignore ) *(f.s) = cstr; // ok to initialize string 276 if ( ! cf.flags.ignore && // ok to initialize string 277 cstr[0] != '\0' ) { // something was read 278 *(f.s) = cstr; 279 } 275 280 } // try 276 281 for ( ; cont; ) { // overflow read ? 277 282 cont = false; 278 283 try { 284 cstr[0] = '\0'; // pre-assign as empty cstring 279 285 is | cf; 280 286 } catch( cstring_length * ) { 281 287 cont = true; // continue not allowed 282 288 } finally { 283 if ( ! cf.flags.ignore ) *(f.s) += cstr; // build string chunk at a time 289 if ( ! cf.flags.ignore && 290 cstr[0] != '\0' ) { // something was read 291 *(f.s) += cstr; // build string chunk at a time 292 } 284 293 } // try 285 294 } // for -
libcfa/src/iostream.cfa
r1b41219 r37ceccb 1021 1021 int check = f.wd - 2; 1022 1022 if (! f.flags.ignore ) { 1023 f.s[0] = '\0';1024 1023 if ( ! f.flags.rwd ) f.s[check] = '\0'; // insert sentinel 1025 1024 } -
tests/collections/.expect/string-istream-manip.txt
r1b41219 r37ceccb 69 69 13 wwwwwwww 70 70 14 cccc 71 15 71 15 q 72 72 1 yyyyyyyyyyyyyyyyyyyy 73 73 2 abcxxx … … 84 84 13 wwwwwwww 85 85 14 cccc 86 15 86 15 q -
tests/collections/string-istream-manip.cfa
r1b41219 r37ceccb 38 38 void echoTillX(const char * casename) { 39 39 string s; 40 do { 40 // loop assumes behaviour not tested until main-case #15: 41 // on reading nothing, the prior string value is left alone 42 do { 43 s = ""; 41 44 forceStringHeapFreeSpaceTo(9); 42 45 sin | s; … … 54 57 string s; 55 58 do { 59 s = ""; 56 60 sin | plainjane( s ); 57 61 sout | casename | s; … … 68 72 string_res s; 69 73 do { 74 s = ""; 70 75 sin | plainjane( s ); 71 76 sout | casename | s; … … 82 87 string s; 83 88 do { 89 s = ""; 84 90 sin | skip("-\n"); 85 91 sin | incl( ".:|# x", s ); … … 97 103 string s; 98 104 do { 105 s = ""; 99 106 sin | skip("-\n"); 100 107 sin | excl( "-\n", s ); … … 113 120 string s; 114 121 do { 122 s = ""; 115 123 sin | getline( s ); 116 124 sout | casename | s; … … 127 135 string s; 128 136 do { 137 s = ""; 129 138 sin | getline( s, '@' ); 130 139 sout | casename | s; -
tests/io/.expect/manipulatorsInput.arm64.txt
r1b41219 r37ceccb 34 34 13 wwwwwwww 35 35 14 cccc 36 15 36 15 q 37 37 a 38 38 a -
tests/io/.expect/manipulatorsInput.x64.txt
r1b41219 r37ceccb 34 34 13 wwwwwwww 35 35 14 cccc 36 15 36 15 q 37 37 a 38 38 a -
tests/io/.expect/manipulatorsInput.x86.txt
r1b41219 r37ceccb 34 34 13 wwwwwwww 35 35 14 cccc 36 15 36 15 q 37 37 a 38 38 a
Note: See TracChangeset
for help on using the changeset viewer.