Subversion Repositories SvarDOS

Rev

Rev 2083 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2083 Rev 2084
Line 190... Line 190...
190
        exitcode = -5;
190
        exitcode = -5;
191
        goto FCLOSE_AND_EXIT;
191
        goto FCLOSE_AND_EXIT;
192
      }
192
      }
193
 
193
 
194
      /* token format is LLLL OOOO OOOO OOOO, where:
194
      /* token format is LLLL OOOO OOOO OOOO, where:
195
       * OOOO OOOO OOOO is the back reference offset (number of bytes to rewind)
195
       * OOOO OOOO OOOO is the back reference offset (number of bytes-1 to rewind)
196
       * LLLL is the number of bytes that have to be copied from the offset
196
       * LLLL is the number of bytes (-1) that have to be copied from the offset
197
       * if the token is > 256 then it represents a literal (single) byte
197
       * if the token is > 256 then it represents a literal (single) byte
198
       */
198
       */
199
 
199
 
200
      /* literal byte? */
200
      /* literal byte? */
201
      if ((buff16[0] & 0xFF00) == 0) {
201
      if ((buff16[0] & 0xFF00) == 0) {
202
        *dst = buff16[0];
202
        *dst = buff16[0];
203
        dst++;
203
        dst++;
204
      } else { /* backreference */
204
      } else { /* backreference */
205
        char *src = dst - (buff16[0] & 0x0FFF);
205
        char *src = dst - (buff16[0] & 0x0FFF) - 1;
206
        buff16[0] >>= 12;
206
        buff16[0] >>= 12;
207
        while (buff16[0]) {
207
        for (;;) {
208
          *dst = *src;
208
          *dst = *src;
209
          dst++;
209
          dst++;
210
          src++;
210
          src++;
-
 
211
          if (buff16[0] == 0) break;
211
          buff16[0]--;
212
          buff16[0]--;
212
        }
213
        }
213
      }
214
      }
214
    }
215
    }
215
    goto FCLOSE_AND_EXIT;
216
    goto FCLOSE_AND_EXIT;