+ current = realloc(current, p_len
+ + c_len // includes '$'
+ + 1 // connecting dot
+ + 1 // terminating 0
+ );
+ if (current) {
+ if (c_len > 1) {
+ memmove(current + p_len + 1 + 1, current + 1, c_len - 1 + 1);
+ current[p_len + 1] = '.';
+ } else {
+ /* just '$' */
+ current[p_len + 1] = '\0';
+ }
+ memcpy(current + 1, prepend, p_len);
+ }
+ return current;
+}