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 _DEFUN (envz_strip
, (envz
, envz_len
),
23 while((entry
= argz_next(*envz
, *envz_len
, entry
)))
25 if(!strchr(entry
, '='))
28 len
= strlen(entry
) + 1;
29 /* Make sure this is not the last entry in envz. If it is, it
30 will be chopped off by the realloc anyway.*/
31 if(*envz
+ *envz_len
!= entry
+ len
- 1)
33 memmove(entry
, entry
+ len
, *envz
+ *envz_len
- entry
- len
);
40 *envz
= (char *)realloc(*envz
, *envz_len
);