|
Lines 1604-1609
void env_array_merge(char ***dest_array, const char **src_array)
Link Here
|
| 1604 |
} |
1604 |
} |
| 1605 |
|
1605 |
|
| 1606 |
/* |
1606 |
/* |
|
|
1607 |
* Merge the environment variables in src_array beginning with "SLURM" into the |
| 1608 |
* array dest_array. Any variables already found in dest_array will be |
| 1609 |
* overwritten with the value from src_array. |
| 1610 |
*/ |
| 1611 |
void env_array_merge_slurm(char ***dest_array, const char **src_array) |
| 1612 |
{ |
| 1613 |
char **ptr; |
| 1614 |
char name[256], *value; |
| 1615 |
|
| 1616 |
if (src_array == NULL) |
| 1617 |
return; |
| 1618 |
|
| 1619 |
value = xmalloc(ENV_BUFSIZE); |
| 1620 |
for (ptr = (char **)src_array; *ptr != NULL; ptr++) { |
| 1621 |
if (_env_array_entry_splitter(*ptr, name, sizeof(name), |
| 1622 |
value, ENV_BUFSIZE) && |
| 1623 |
(strncmp(name, "SLURM", 5) == 0)) |
| 1624 |
env_array_overwrite(dest_array, name, value); |
| 1625 |
} |
| 1626 |
xfree(value); |
| 1627 |
} |
| 1628 |
|
| 1629 |
/* |
| 1607 |
* Strip out trailing carriage returns and newlines |
1630 |
* Strip out trailing carriage returns and newlines |
| 1608 |
*/ |
1631 |
*/ |
| 1609 |
static void _strip_cr_nl(char *line) |
1632 |
static void _strip_cr_nl(char *line) |