From 85e0b4cd612d6aac607ec5c3e8a24b2ced089453 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Mon, 8 Oct 2018 19:28:18 -0500 Subject: [PATCH] Strip all angle brackets before storing a callsign in the hashtable. Make encode77 work with ' K1JT R+02'. --- lib/77bit/packjt77.f90 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/77bit/packjt77.f90 b/lib/77bit/packjt77.f90 index b1dd3be37..aa06abf6d 100644 --- a/lib/77bit/packjt77.f90 +++ b/lib/77bit/packjt77.f90 @@ -71,17 +71,13 @@ end subroutine hash22 integer function ihashcall(c0,m) integer*8 n8 - character*13 c0,c1 + character*13 c0 character*38 c data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - c1=c0 - if(c1(1:1).eq.'<') c1=c1(2:) - i=index(c1,'>') - if(i.gt.0) c1(i:)=' ' n8=0 do i=1,11 - j=index(c,c1(i:i)) - 1 + j=index(c,c0(i:i)) - 1 n8=38*n8 + j enddo ihashcall=ishft(47055833459_8*n8,m-64) @@ -91,7 +87,7 @@ end function ihashcall subroutine save_hash_call(c13,n10,n12,n22) - character*13 c13 + character*13 c13,cw logical first data first/.true./ save first @@ -104,12 +100,16 @@ subroutine save_hash_call(c13,n10,n12,n22) nzhash=0 first=.false. endif - - if(c13(1:1).eq.' ' .or. c13(1:5).eq.'<...>') return + + cw=c13 + if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return + if(cw(1:1).eq.'<') cw=cw(2:) + i=index(cw,'>') + if(i.gt.0) cw(i:)=' ' - n10=ihashcall(c13,10) - n12=ihashcall(c13,12) - n22=ihashcall(c13,22) + n10=ihashcall(cw,10) + n12=ihashcall(cw,12) + n22=ihashcall(cw,22) do i=1,nzhash if(ihash22(i).eq.n22) go to 900 !This one is already in the table enddo @@ -124,7 +124,7 @@ subroutine save_hash_call(c13,n10,n12,n22) ihash10(1)=n10 ihash12(1)=n12 ihash22(1)=n22 - callsign(1)=c13 + callsign(1)=cw if(nzhash.lt.MAXHASH) nzhash=nzhash+1 900 return @@ -662,7 +662,7 @@ subroutine unpack28(n28_0,c13,success) c13=adjustl(c13) 900 i0=index(c13,' ') - if(i0.lt.len(trim(c13))) then + if(i0.ne.0 .and. i0.lt.len(trim(c13))) then c13='QU1RK' success=.false. endif