Mercurial > ~dholland > hg > tradcpp > index.cgi
comparison macro.c @ 27:01c3a2088ab4
fix some more bugs
author | David A. Holland |
---|---|
date | Mon, 20 Dec 2010 05:01:18 -0500 |
parents | 18681e5ae6e4 |
children | 8a955e3dda2c |
comparison
equal
deleted
inserted
replaced
26:ac45dcc57ff9 | 27:01c3a2088ab4 |
---|---|
465 const char *param; | 465 const char *param; |
466 | 466 |
467 num = stringarray_num(&m->params); | 467 num = stringarray_num(&m->params); |
468 for (i=0; i<num; i++) { | 468 for (i=0; i<num; i++) { |
469 param = stringarray_get(&m->params, i); | 469 param = stringarray_get(&m->params, i); |
470 if (strlen(param) == len && !strcmp(name, param)) { | 470 if (strlen(param) == len && !memcmp(name, param, len)) { |
471 *num_ret = i; | 471 *num_ret = i; |
472 return true; | 472 return true; |
473 } | 473 } |
474 } | 474 } |
475 return false; | 475 return false; |
491 pos += strspn(buf+pos, alnum); | 491 pos += strspn(buf+pos, alnum); |
492 if (isparam(m, buf+wordstart, pos-wordstart, ¶m)) { | 492 if (isparam(m, buf+wordstart, pos-wordstart, ¶m)) { |
493 if (pos > blockstart) { | 493 if (pos > blockstart) { |
494 ei = expansionitem_create_stringlen( | 494 ei = expansionitem_create_stringlen( |
495 buf + blockstart, | 495 buf + blockstart, |
496 pos - blockstart); | 496 wordstart - blockstart); |
497 expansionitemarray_add(&m->expansion, | 497 expansionitemarray_add(&m->expansion, |
498 ei, NULL); | 498 ei, NULL); |
499 } | 499 } |
500 ei = expansionitem_create_param(param); | 500 ei = expansionitem_create_param(param); |
501 expansionitemarray_add(&m->expansion, ei,NULL); | 501 expansionitemarray_add(&m->expansion, ei,NULL); |