* Internal functions for string lookup. */
| 413 | * Internal functions for string lookup. |
| 414 | */ |
| 415 | static char * |
| 416 | _getenv_dynamic_locked(const char *name, int *idx) |
| 417 | { |
| 418 | char *cp; |
| 419 | int len, i; |
| 420 | |
| 421 | len = strlen(name); |
| 422 | for (cp = kenvp[0], i = 0; cp != NULL; cp = kenvp[++i]) { |
| 423 | if ((strncmp(cp, name, len) == 0) && |
| 424 | (cp[len] == '=')) { |
| 425 | if (idx != NULL) |
| 426 | *idx = i; |
| 427 | return (cp + len + 1); |
| 428 | } |
| 429 | } |
| 430 | return (NULL); |
| 431 | } |
| 432 | |
| 433 | static char * |
| 434 | _getenv_dynamic(const char *name, int *idx) |
no test coverage detected