aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-20 20:35:55 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-21 11:19:55 +0200
commit342f5d25722f45c35ce52bfbb69ea25c5234ee58 (patch)
treeee960b4c2763c53221d019a5ccdc4dfc419eaa8c
parentc878e4340f70f3ccafea25a9735aca259207d38b (diff)
downloadfref-342f5d25722f45c35ce52bfbb69ea25c5234ee58.tar.gz
Remove double period after author
-rw-r--r--fref.lex14
1 files changed, 9 insertions, 5 deletions
diff --git a/fref.lex b/fref.lex
index 0541e1e..4a34aa8 100644
--- a/fref.lex
+++ b/fref.lex
@@ -166,14 +166,18 @@ harvard()
/* Print authors. */
for(i = 0; i < e.a-2; i++)
- printf("%s, ", e.au[i]);
+ pf("*, ", e.au[i]);
if(i == e.a-2)
- printf("%s %s ", e.au[i++], t->and);
+ pf("* * ", e.au[i++], t->and);
if(i == e.a-1)
- printf("%s", e.au[i]);
+ pf("*", e.au[i]);
/* Print date. */
- (pf(" (%).\n", e.da) || (e.a ? pf(".\n") : 0));
+ if(!pf(" (%).\n", e.da) && e.a){
+ if(e.au[i][strlen(e.au[i])-1] != '.')
+ pf(".");
+ pf("\n");
+ }
/* Print title, book/journal. */
if(*e.bo || *e.jo){
@@ -188,7 +192,7 @@ harvard()
/* Print pages, converting hyphens to en dashes. */
if(*e.pp){
- printf(", %s", strpbrk(e.pp, ",-") ? t->pp : t->p);
+ pf(", *", strpbrk(e.pp, ",-") ? t->pp : t->p);
for(i = 0; i < strlen(e.pp); i++){
if(e.pp[i] == '-') putchar('\\');
putchar(e.pp[i]);