Clone
ixen
committed
on 23 Dec 20
Fixed problem with shell extension incorrectly identifying operation to be performed when handling more than 16 files at once (CH-370).
ext/libicpf/src/circ_buffer.cpp (+1 -1)
502 502                         else
503 503                         {
504 504                                 // are there any bits left in the w ?
505 505                                 if (ulBits > 0)
506 506                                 {
507 507                                         // there are some bits left, so we should add a bit or two to make sure nothing is lost
508 508 //                                      printf("$$$ Some (%lu) bits left. Current cache=%u\n", ulBits, w);
509 509                                         ulBits=ulBitsCount;
510 510                                 }
511 511                                 else
512 512                                 {
513 513                                         // there are no data left in the internal buffer, so finish the operation
514 514 //                                      printf("&&& Leaving with %lu bits left\n", ulBits);
515 515                                         return;
516 516                                 }
517 517                         }
518 518                 }
519 519                 else
520 520                 {
521 521                         // call the callback function with the ucData as a param
522                           byte_t uc=(byte_t)(w & 0xff) << (8-ulBitsCount);
  522                         byte_t uc=(byte_t)((w & 0xff) << (8-ulBitsCount));
523 523                         uc >>= 8-ulBitsCount;
524 524                         
525 525                         (*pfn)(uc, pParam);
526 526                         
527 527                         // update variables
528 528                         ulBits-=ulBitsCount;
529 529                         w >>= ulBitsCount;
530 530                 }
531 531         }
532 532 }
533 533
534 534 /*void circular_buffer::dump()
535 535 {
536 536         printf("circular_buffer::Dump()\n\tsize of data: %lu\n\tsizeof the buffer: %lu\n\tbits at end: %lu", m_tDataSize, m_tSize, m_tBitsAtEndCount);
537 537         for (unsigned long i=0;i<m_tDataSize;i++)
538 538         {
539 539                 if ( (i % 16) == 0 )
540 540                         printf("\n\t");
541 541                 
542 542                 printf("0x%02lx,", (unsigned long)m_pbyBuffer[i]);