17#include "../dlib/dlib.h"
41 MSG(
"paths: Error changing directory to /tmp: %s\n",
46 if (stat(
path, &st) == -1) {
47 if (errno == ENOENT) {
48 MSG(
"paths: Creating directory '%s/'\n",
path);
49 if (mkdir(
path, 0700) < 0) {
50 MSG(
"paths: Error creating directory %s: %s\n",
85 if (!(fp = fopen(
path,
"r"))) {
88 char *path2 =
dStrconcat(DILLO_SYSCONF, rcFile, NULL);
89 if (!(fp = fopen(path2,
"r"))) {
90 MSG(
"paths: Cannot open file '%s': %s\n", path2,
dStrerror(errno));
91 MSG(
"paths: Using internal defaults...\n");
93 MSG(
"paths: Using %s\n", path2);
static char * getOldWorkingDir(void)
Return the initial current working directory in a string.
static void init(void)
Changes current working directory to /tmp and creates ~/.dillo if not exists.
static FILE * getPrefsFP(const char *rcFile)
Examines the path for "rcFile" and assign its file pointer to "fp".
static void free(void)
Free memory.
char * dStrconcat(const char *s1,...)
Concatenate a NULL-terminated list of strings.
char * dGethomedir(void)
Return the home directory in a static string (don't free)
char * dGetcwd(void)
Return the current working directory in a new string.
static char * oldWorkingDir