462 break; |
462 break; |
463 } |
463 } |
464 } |
464 } |
465 |
465 |
466 done: |
466 done: |
467 int canonLen = 0; |
|
468 |
467 |
469 if (success) { |
468 if (success) { |
470 /* the path looks fine; return the canonicalized form */ |
469 /* the path looks fine; return the canonicalized form */ |
471 canonLen = (int) (out_ptr - canonPath); |
470 unsigned canonLen = (unsigned) (out_ptr - canonPath); |
472 canonPath[canonLen] = '\0'; |
471 canonPath[canonLen] = '\0'; |
|
472 if (pcanonlen) *pcanonlen = (int) canonLen; |
473 } else { |
473 } else { |
474 /* error canonicalizing */ |
474 /* error canonicalizing */ |
475 pool_free(pool, canonPath); |
475 pool_free(pool, canonPath); |
476 canonPath = NULL; |
476 canonPath = NULL; |
477 } |
477 if (pcanonlen) *pcanonlen = 0; |
478 |
478 } |
479 if (pcanonlen) |
|
480 *pcanonlen = canonLen; |
|
481 |
479 |
482 return canonPath; |
480 return canonPath; |
483 } |
481 } |
484 |
482 |
485 |
483 |