1 /* Copyright (C) 2002, 2005 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.
12 #define __need_ptrdiff_t
16 argz_insert (char **argz
,
25 return argz_add(argz
, argz_len
, entry
);
27 if (before
< *argz
|| before
>= *argz
+ *argz_len
)
30 while (before
!= *argz
&& before
[-1])
33 /* delta will always be non-negative, and < *argz_len */
34 delta
= before
- *argz
;
36 len
= strlen(entry
) + 1;
38 if(!(*argz
= (char *)realloc(*argz
, *argz_len
+ len
)))
41 memmove(*argz
+ delta
+ len
, *argz
+ delta
, *argz_len
- delta
);
42 memcpy(*argz
+ delta
, entry
, len
);