1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
15 envz_strip (char **envz
,
22 while((entry
= argz_next(*envz
, *envz_len
, entry
)))
24 if(!strchr(entry
, '='))
27 len
= strlen(entry
) + 1;
28 /* Make sure this is not the last entry in envz. If it is, it
29 will be chopped off by the realloc anyway.*/
30 if(*envz
+ *envz_len
!= entry
+ len
- 1)
32 memmove(entry
, entry
+ len
, *envz
+ *envz_len
- entry
- len
);
39 *envz
= (char *)realloc(*envz
, *envz_len
);