src/string.c

changeset 1668
3ffdfe1776b4
parent 1667
608cc0b25352
child 1671
cf19b7820ff0
equal deleted inserted replaced
1667:608cc0b25352 1668:3ffdfe1776b4
503 return result; 503 return result;
504 } 504 }
505 505
506 cxstring cx_strtrim(cxstring string) { 506 cxstring cx_strtrim(cxstring string) {
507 cxstring result = string; 507 cxstring result = string;
508 while (result.length > 0 && isspace((unsigned char)(result.ptr[0]))) { 508 while (isspace((unsigned char)cx_strat(result, 0))) {
509 result.ptr++; 509 result.ptr++;
510 result.length--; 510 result.length--;
511 } 511 }
512 while (result.length > 0 && isspace((unsigned char)result.ptr[result.length - 1])) { 512 while (isspace((unsigned char)cx_strat(result, -1))) {
513 result.length--; 513 result.length--;
514 } 514 }
515 return result; 515 return result;
516 } 516 }
517 517

mercurial