From 3d568ac772be8445846dcce73e90242d774f5270 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 11 Oct 2000 14:59:46 +0000 Subject: [PATCH] A fix from Yamano'uchi to get correct font names. --- src/cid/cidparse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c index 815e1ed52..c1594351f 100644 --- a/src/cid/cidparse.c +++ b/src/cid/cidparse.c @@ -96,7 +96,8 @@ buff_len = 256; for (;;) { - FT_Byte *p, *limit = buffer + 256; + FT_Byte *p, *limit = buffer + 256; + FT_ULong top_position; /* fill input buffer */ @@ -104,9 +105,12 @@ if ( buff_len > 0 ) MEM_Move( buffer, limit, buff_len ); - if ( FILE_Read( buffer, 256 + 10 - buff_len ) ) + p = buffer + buff_len; + + if ( FILE_Read( p, 256 + 10 - buff_len ) ) goto Exit; + top_position = FILE_Pos() - buff_len; buff_len = 256 + 10; /* look for `StartData' */ @@ -115,7 +119,7 @@ if ( p[0] == 'S' && strncmp( (char*)p, "StartData", 9 ) == 0 ) { /* save offset of binary data after `StartData' */ - offset = FILE_Pos() - ( limit - p ) + 10; + offset = top_position - ( limit - p ) + 10; goto Found; } }