9 static size_t argv_len(char *const argv
[])
13 for (; argv
&& *argv
; argv
++)
19 int cpp_exec(char *in_file
, char *out_file
, size_t out_len
, char *const argv
[])
21 size_t argc
= 7 + argv_len(argv
);
22 char *tmp
= xstrdup(in_file
);
29 slprintf(out_file
, out_len
, "/tmp/.tmp-%u-%s", rand(), base
);
31 cpp_argv
= xmalloc(argc
* sizeof(char *));
33 cpp_argv
[i
++] = "cpp";
35 for (; argv
&& *argv
; argv
++, i
++)
39 cpp_argv
[i
++] = ETCDIRE_STRING
;
41 cpp_argv
[i
++] = out_file
;
42 cpp_argv
[i
++] = in_file
;
45 if (proc_exec("cpp", cpp_argv
))