diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/dillo.cc | 6 | ||||
-rw-r--r-- | src/paths.cc | 7 |
3 files changed, 11 insertions, 4 deletions
@@ -11,6 +11,8 @@ dillo-2.2 [??, 2009] +- Removed redundant system includes. Added the "nop" keybinding (nop = NO_OPERATION; cancels a default hook). Patches: place (AKA corvid) ++- Check chdir() return code in Paths::init. + Patch: Michal Nowak ----------------------------------------------------------------------------- diff --git a/src/dillo.cc b/src/dillo.cc index 078de258..3e663a4d 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -258,15 +258,15 @@ int main(int argc, char **argv) } dFree(opt_argv); + // set the default values for the preferences + a_Prefs_init(); + // create ~/.dillo if not present Paths::init(); // initialize default key bindings Keys::init(); - // set the default values for the preferences - a_Prefs_init(); - // parse dillorc if ((fp = Paths::getPrefsFP(PATHS_RC_PREFS))) { PrefsParser::parse(fp); diff --git a/src/paths.cc b/src/paths.cc index 8c5bd20a..9d0abda0 100644 --- a/src/paths.cc +++ b/src/paths.cc @@ -32,10 +32,15 @@ void Paths::init(void) { char *path; struct stat st; + int rc = 0; dFree(oldWorkingDir); oldWorkingDir = dGetcwd(); - chdir("/tmp"); + rc = chdir("/tmp"); + if (rc == -1) { + MSG("paths: error changing directory to /tmp: %s\n", + dStrerror(errno)); + } path = dStrconcat(dGethomedir(), "/.dillo", NULL); if (stat(path, &st) == -1) { |