8 static size_t argv_len(char *const argv
[])
12 for (; argv
&& *argv
; argv
++)
18 int cpp_exec(char *in_file
, char *out_file
, size_t out_len
, char *const argv
[])
20 size_t argc
= 7 + argv_len(argv
);
21 char *tmp
= xstrdup(in_file
);
28 slprintf(out_file
, out_len
, "/tmp/.tmp-%u-%s", rand(), base
);
30 cpp_argv
= xmalloc(argc
* sizeof(char *));
32 cpp_argv
[i
++] = "cpp";
34 for (; argv
&& *argv
; argv
++, i
++)
38 cpp_argv
[i
++] = ETCDIRE_STRING
;
40 cpp_argv
[i
++] = out_file
;
41 cpp_argv
[i
++] = in_file
;
44 if (proc_exec("cpp", cpp_argv
))