Changeset 1827 for trunk/src/kmk/read.c


Ignore:
Timestamp:
Oct 11, 2008, 9:12:10 AM (17 years ago)
Author:
bird
Message:

kmk: more length optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/read.c

    r1821 r1827  
    469469
    470470int
     471#ifndef CONFIG_WITH_VALUE_LENGTH
    471472eval_buffer (char *buffer)
     473#else
     474eval_buffer (char *buffer, char *eos)
     475#endif
    472476{
    473477  struct ebuffer ebuf;
     
    479483  /* Evaluate the buffer */
    480484
     485#ifndef CONFIG_WITH_VALUE_LENGTH
    481486  ebuf.size = strlen (buffer);
     487#else
     488  ebuf.size = eos - buffer;
     489  ebuf.eol = eos;
     490  assert(strchr(buffer, '\0') == eos);
     491#endif
    482492  ebuf.buffer = ebuf.bufnext = ebuf.bufstart = buffer;
    483493  ebuf.fp = NULL;
    484 #ifdef CONFIG_WITH_VALUE_LENGTH
    485   ebuf.eol = ebuf.buffer + ebuf.size;
    486 #endif
    487494
    488495  ebuf.floc = *reading_file;
     
    19541961      if ((size_t)buf_pos & 7)
    19551962        buf_pos = variable_buffer_output (buf_pos, "\0\0\0\0\0\0\0\0",
    1956                                           8 - (size_t)buf_pos & 7);
    1957       s2 = variable_expand_string (buf_pos, s2, l);
     1963                                          8 - ((size_t)buf_pos & 7));
     1964      s2 = variable_expand_string_2 (buf_pos, s2, l, &buf_pos);
    19581965#endif
    19591966#ifdef CONFIG_WITH_SET_CONDITIONALS
Note: See TracChangeset for help on using the changeset viewer.