@@ -248,14 +248,8 @@ contains |
| 248 | end_pos = int(newline_pos, c_size_t) + 1 | 248 | end_pos = int(newline_pos, c_size_t) + 1 |
| 249 | end if | 249 | end if |
| 250 | | 250 | |
| 251 | - ! Calculate line length (excluding newline) | 251 | + ! Calculate line length (excluding newline, but preserving CR like grep) |
| 252 | line_len = end_pos - start_pos | 252 | line_len = end_pos - start_pos |
| 253 | - if (line_len > 0 .and. end_pos > start_pos) then | | |
| 254 | - ! Check for CR before LF (Windows line ending) | | |
| 255 | - if (file_data(end_pos - 1) == char(13)) then | | |
| 256 | - line_len = line_len - 1 | | |
| 257 | - end if | | |
| 258 | - end if | | |
| 259 | | 253 | |
| 260 | ! Allocate and copy line | 254 | ! Allocate and copy line |
| 261 | if (line_len > 0) then | 255 | if (line_len > 0) then |
@@ -323,14 +317,8 @@ contains |
| 323 | end_pos = int(newline_pos, c_size_t) | 317 | end_pos = int(newline_pos, c_size_t) |
| 324 | end if | 318 | end if |
| 325 | | 319 | |
| 326 | - ! Calculate line length (excluding newline and CR) | 320 | + ! Calculate line length (excluding newline, but preserving CR like grep) |
| 327 | line_len = end_pos - start_pos | 321 | line_len = end_pos - start_pos |
| 328 | - if (line_len > 0 .and. end_pos > start_pos) then | | |
| 329 | - ! Check for CR before LF (Windows line ending) | | |
| 330 | - if (file_data(end_pos) == char(13)) then | | |
| 331 | - line_len = line_len - 1 | | |
| 332 | - end if | | |
| 333 | - end if | | |
| 334 | | 322 | |
| 335 | ! Store line info | 323 | ! Store line info |
| 336 | batch%count = batch%count + 1 | 324 | batch%count = batch%count + 1 |