|
|
/* Run some stuff in a subshell (Ooh my, how ugly): */ | /* Run some stuff in a subshell (Ooh my, how ugly): */ |
FILE *ptr; | FILE *ptr; |
ptr = | ptr = |
popen("source /etc/make.globals;" |
popen(". /etc/make.globals;" |
"source /etc/make.conf;" "echo -n ${PORTDIR}", "r"); |
". /etc/make.conf;" "echo -n ${PORTDIR}", "r"); |
if (fgets(portdir, (int)FILENAME_MAX, ptr) == NULL) | if (fgets(portdir, (int)FILENAME_MAX, ptr) == NULL) |
doerror(FILE_ERR, NULL, NULL); | doerror(FILE_ERR, NULL, NULL); |
if (strlen(portdir) == 0) | if (strlen(portdir) == 0) |