Skip to content

Commit ea2ee73

Browse files
committed
fix split_lines
1 parent 837590c commit ea2ee73

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/fpm_strings.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ pure subroutine split_lines_first_last(string, first, last)
576576
n = n + 1
577577
istart(n) = p
578578
do while (p <= slen)
579-
if (index(CR//LF, string(p:p)) == 0) exit
579+
if (index(CR//LF, string(p:p)) /= 0) exit
580580
p = p + 1
581581
end do
582582
iend(n) = p - 1

test/fpm_test/test_filesystem.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ subroutine test_split_lines_first_last(error)
304304
integer, allocatable :: first(:), last(:)
305305

306306
call split_lines_first_last(CR//LF//'line1'//CR//'line2'//LF//'line3'//CR//LF//'hello', first, last)
307-
if (.not.(all(first==[3,9,15,21]) .and. all(last==[7,13,18,25]))) then
307+
if (.not.(all(first==[3,9,15,22]) .and. all(last==[7,13,19,26]))) then
308308
call test_failed(error, "Test split_lines_first_last #1 failed")
309309
return
310310
end if

0 commit comments

Comments
 (0)