Subversion Repositories SvarDOS

Rev

Rev 2108 | Rev 2113 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2108 Rev 2112
Line 418... Line 418...
418
    } else {
418
    } else {
419
      minmatch = 2;
419
      minmatch = 2;
420
    }
420
    }
421
 
421
 
422
    for (; matchlen >= minmatch; matchlen--) {
422
    for (; matchlen >= minmatch; matchlen--) {
423
      /* start at -matchlen and try to match something moving backward */
423
      /* start at -1 and try to match something moving backward */
424
      unsigned short maxoffset = 4096;
424
      unsigned short maxoffset = 4096;
425
      if (maxoffset > bytesprocessed) maxoffset = bytesprocessed;
425
      if (maxoffset > bytesprocessed) maxoffset = bytesprocessed;
426
 
426
 
427
      for (offset = matchlen; offset <= maxoffset; offset++) {
427
      for (offset = 1; offset <= maxoffset; offset++) {
428
        if (memcmp(src, src - offset, matchlen) == 0) {
428
        if (memcmp(src, src - offset, matchlen) == 0) {
429
          //printf("Found match of %u bytes at offset -%u: '%c%c%c...'\n", matchlen, offset, src[0], src[1], src[2]);
429
          //printf("Found match of %u bytes at offset -%u: '%c%c%c...'\n", matchlen, offset, src[0], src[1], src[2]);
430
          goto FOUND;
430
          goto FOUND;
431
        }
431
        }
432
      }
432
      }