nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Patch for bug #44950


From: Rishabh Dave
Subject: Re: [Nano-devel] Patch for bug #44950
Date: Sat, 16 Jan 2016 00:26:46 +0530

Hello,

I am sending this unfinished patch because I think I solved that "lockfile business" stuff. And I think it would be most of work except for few minor issues. If this works for lockfile, I will send another patch sincerely finished. My only reason behind sending unfinished patch is to save time. I hopes this aids rather than becoming a hindrance. If so, I will send completely finished patch.

On doing './nano -G nonexistent-dir/some-file' nano used to report on statusbar "Error writing lock file: Directory 'nonesxistent-dir' doesn't exist" and later (in last patch) it used to skip that message and report while providing an input "Warning: Modifying a file which is not locked, check directory permission?"

This time it only says "Directory nonexistent-dir doesn't exist" and one could save safely and normally. So, I guess case solved?

Some questions -

If './nano a/b/c/d/e' is done where 'a' is only existent directory and 'e' is regular file then what should nano print "Directory b doesn't exist" or "Directory b/c/d/ doesn't exist" or something else? I am afraid I may be missing some point because initially I printed latter and you asked me for former and we are on latter again, I guess.

Is it okay to get rid of faulty_path variable (global or in struct) and call fault_in_path() whenever required. (fault_in_path() has bool return type for avoiding memory leak) ? Total count of calling fault_in_path() would be thrice per filename irrespectively. If we only want "Directory b doesn't exist" (for './nano a/b/c/d/e') then fault_in_path() would be pretty short, then, maybe, multiple calls might not matter.

I am working on nano-2.5.1 with your patch applied and after correcting most of mistakes you pointed out (replacing do-while loop by while loop, etc. ). Hopefully, I took care of whitespaces.

Attachment: only-lockfile-case-covered.patch
Description: Text Data


reply via email to

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