Skip to content

Commit

Permalink
Bibliography: Add safeguards against incomplete ISI records
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Jun 10, 2023
1 parent f03b9d5 commit 40b4148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/reference_manager.F
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ SUBROUTINE add_reference(key, ISI_record, DOI)
author = get_next_author(thebib(key)%ref%ISI_record, line)
commaloc = INDEX(author, ',')
IF (commaloc .GT. 0) author = author(1:commaloc - 1)
CPASSERT(LEN_TRIM(author) > 0)
year = get_year(thebib(key)%ref%ISI_record)
CPASSERT(LEN_TRIM(year) == 4)
citation_key = TRIM(author)//TRIM(year)
IF (citation_key == "") citation_key = "unknown"

! avoid special characters in names, just remove them
mylen = LEN_TRIM(citation_key)
Expand All @@ -176,6 +177,7 @@ SUBROUTINE add_reference(key, ISI_record, DOI)
END IF
END DO
citation_key(ires + 1:) = ""
CPASSERT(LEN_TRIM(citation_key) > 4) ! At least one character of the author should be left.

! avoid duplicates, search through the list for matches (case-insensitive)
mylen = LEN_TRIM(citation_key)
Expand Down

0 comments on commit 40b4148

Please sign in to comment.