Changeset 8730afb in git for processor/string.m4


Ignore:
Timestamp:
2009-07-08T04:40:03Z (11 years ago)
Author:
Xuefer <xuefer@…>
Branches:
1.3
Children:
2b31f23
Parents:
f250c2a
Message:

merged r645 from trunk

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@646 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • processor/string.m4

    r6a5fa6a r8730afb  
    2121            STRTYPE, `zstr_char',  `ZSTR_S($1)',
    2222            `',      `',           `$1'))
     23    pushdef(`U', ifelse(
     24            PTRTYPE, `char',  `',
     25            PTRTYPE, `UChar', `u'))
    2326    if (SRCPTR == NULL) {
    2427        IFNOTMEMCPY(`IFCOPY(`
     
    5659            ')
    5760        ')
    58         IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__'));')
    59         IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__')));')
     61        IFCALC(`xc_calc_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__'));')
     62        IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__')));')
    6063        IFRESTORE(`
    61             ALLOC(DSTPTR, `STRTYPE', `($3)')
    62             memcpy(DSTPTR, SRCPTR, sizeof(STRTYPE) * ($3));
     64            DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1);
    6365        ')
    6466        FIXPOINTER_EX(`PTRTYPE', DSTPTR)
     
    7577        ')
    7678    }
     79    popdef(`U')
    7780    popdef(`DSTPTR')
    7881    popdef(`SRCPTR')
Note: See TracChangeset for help on using the changeset viewer.