[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] browser: remove topmost opendir()

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] browser: remove topmost opendir()
Date: Mon, 04 Jul 2016 21:37:37 +0200

On Mon, Jul 4, 2016, at 13:41, Rishabh Dave wrote:
> Since, I shouldn't alter the if-statement, I must make it pass (when
> control enters do_browser() for very first time) to allow opendir();
> this should be the first tiny change at the very beginning.

This is not tiny enough:

-    char *retval = NULL, *newpath = NULL;
+    char *retval = NULL, *newpath = mallocstrcpy(NULL, path);

This is:

-    char *retval = NULL, *newpath = NULL;
+    char *retval = NULL, *newpath = path;

> Omitting
> opendir() and the block below should be second (tiny?) change;

No, that's not tiny; that's a good cut.

What I meant was to prevent this:
  path = mallocstrassn(path, get_full_path(newpath ? newpath : path));
from freeing path; it shouldn't because the value has been handed over
to newpath.  So, to prevent the freeing, simply set path to NULL before
entering the label loop.

> About improved response, if do ^R nor ^T , I can only hear the beep.
> So, is receiving of message the improved response?

Yes, showing a message instead of just beeping is an improved response.

But since I've now given complete instructions, I've pushed the patch
myself.  Plus the removal of a distracting setting of the help lines
(in case of the above error message).

Next step: see if you can get rid of newpath by using path instead,
and using present_path as a "backup".


-- - Or how I learned to stop worrying and
                          love email again

reply via email to

[Prev in Thread] Current Thread [Next in Thread]