[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] browser: inaccessible directory remains unselec
From: |
Rishabh Dave |
Subject: |
Re: [Nano-devel] [PATCH] browser: inaccessible directory remains unselected when tabbed in goto directory prompt |
Date: |
Fri, 1 Jul 2016 19:51:25 +0530 |
On Fri, Jul 1, 2016 at 3:45 PM, Benno Schulenberg
<address@hidden> wrote:
>
> Thanks. The patch is good. But I don't like the extra variable,
> so I would write things more densely:
>
> + /* Snip a trailing slash, so the name can be compared. */
> + if (strlen(newpath) > 1 && newpath[strlen(newpath) - 1] == '/')
> + newpath[strlen(newpath) - 1] = '\0';
>
> This calls strlen() three times, but we are not in a hurry here.
> And... maybe the compiler is smart enough to not actually make
> that call three times in a row.
Intially I too wrote this way but I wasn't sure, so changed my decision.
At last moment, I saw variable "i" which we are reusing right below.
So, technically, we can reuse it here too. So, there are two patches
(with same name). You may select any.
0001-browser-select-inaccessible-directory-when-tabbed.patch
Description: Text Data
0001-browser-select-inaccessible-directory-when-tabbed.patch
Description: Text Data