Re: Dillo working directory

123 <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Sun, May 27, 2012 at 04:57:24PM +0400, 123 wrote:
> In Paths::init Dillo changes working directory to /tmp. This way every
> time I try to open some page stored on the hard disk (Ctrl-O) I have
> to start in /tmp. What is the reason for changing WD to /tmp? BTW
> oldWorkingDir is not used anywhere.

oldWorkingDir is used in fact, it was a mistake.

I have searched mailing list and found thread [1] [2] [3] discussing
the same issue, but there is no rationale.

I also found line in ChangeLog

 - Fixed Dillo and its dpis to work from "/tmp" (for easy device unmount).

Most of the time Dillo is running from $HOME and unmounting it is not
common.

It may be that someone changes directory to, for example, /mnt, runs
dillo there and exits shell (or changes its WD), but it is not common
scenario too.

The problem with changing directory to /tmp is that open dialog starts
in /tmp, it is a bug. As a workaround I am typing "file:" in location,
it uses oldWorkingDir then.

I have attached patch, it fixes the problem. It is still not finished
without removing obsolete oldWorkingDir and using real current
directory.

Are there any other hidden problems?  If not, I will make finished patch.

[1] http://lists.auriga.wearlab.de/pipermail/dillo-dev/2011-December/009221.html
[2] http://lists.auriga.wearlab.de/pipermail/dillo-dev/2011-December/009223.html
[3] http://lists.auriga.wearlab.de/pipermail/dillo-dev/2011-December/009225.html

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
cwd.patch (text/plain, 435 B)
diff -r c3f8d2d9831a src/paths.cc
--- a/src/paths.cc
+++ b/src/paths.cc
@@ -32,15 +32,9 @@
 {
    char *path;
    struct stat st;
-   int rc = 0;
 
    dFree(oldWorkingDir);
    oldWorkingDir = dGetcwd();
-   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) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.