@ -211,7 +211,7 @@ msg_fetched( int sts, void *aux )
copy_vars_t * vars = ( copy_vars_t * ) aux ;
copy_vars_t * vars = ( copy_vars_t * ) aux ;
SVARS ( vars - > aux )
SVARS ( vars - > aux )
char * fmap , * buf ;
char * fmap , * buf ;
int i , len , extra , scr , tcr , lcrs , crs , lines ;
int i , len , extra , scr , tcr , lcrs , hcrs , b crs, lines ;
int start , sbreak = 0 , ebreak = 0 ;
int start , sbreak = 0 , ebreak = 0 ;
char c ;
char c ;
@ -224,7 +224,7 @@ msg_fetched( int sts, void *aux )
if ( vars - > srec | | scr ! = tcr ) {
if ( vars - > srec | | scr ! = tcr ) {
fmap = vars - > data . data ;
fmap = vars - > data . data ;
len = vars - > data . len ;
len = vars - > data . len ;
extra = lines = crs = i = 0 ;
extra = lines = hcrs = b crs = i = 0 ;
if ( vars - > srec ) {
if ( vars - > srec ) {
nloop :
nloop :
start = i ;
start = i ;
@ -239,7 +239,7 @@ msg_fetched( int sts, void *aux )
goto oke ;
goto oke ;
}
}
lines + + ;
lines + + ;
crs + = lcrs ;
h crs + = lcrs ;
if ( i - lcrs - 1 = = start ) {
if ( i - lcrs - 1 = = start ) {
sbreak = ebreak = start ;
sbreak = ebreak = start ;
goto oke ;
goto oke ;
@ -253,17 +253,17 @@ msg_fetched( int sts, void *aux )
free ( fmap ) ;
free ( fmap ) ;
return vars - > cb ( SYNC_NOGOOD , 0 , vars ) ;
return vars - > cb ( SYNC_NOGOOD , 0 , vars ) ;
oke :
oke :
extra + = 8 + TUIDL + 1 + ( tcr & & crs ) ;
extra + = 8 + TUIDL + 1 + ( tcr & & h crs) ;
}
}
if ( tcr ! = scr ) {
if ( tcr ! = scr ) {
for ( ; i < len ; i + + ) {
for ( ; i < len ; i + + ) {
c = fmap [ i ] ;
c = fmap [ i ] ;
if ( c = = ' \r ' )
if ( c = = ' \r ' )
crs + + ;
b crs+ + ;
else if ( c = = ' \n ' )
else if ( c = = ' \n ' )
lines + + ;
lines + + ;
}
}
extra - = crs ;
extra - = hcrs + b crs;
if ( tcr )
if ( tcr )
extra + = lines ;
extra + = lines ;
}
}
@ -294,7 +294,7 @@ msg_fetched( int sts, void *aux )
buf + = 8 ;
buf + = 8 ;
memcpy ( buf , vars - > srec - > tuid , TUIDL ) ;
memcpy ( buf , vars - > srec - > tuid , TUIDL ) ;
buf + = TUIDL ;
buf + = TUIDL ;
if ( tcr & & crs )
if ( tcr & & h crs)
* buf + + = ' \r ' ;
* buf + + = ' \r ' ;
* buf + + = ' \n ' ;
* buf + + = ' \n ' ;
i = ebreak ;
i = ebreak ;