nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER


From: David Benbennick
Subject: Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER
Date: Wed, 13 Mar 2002 12:06:36 -0500 (EST)

And here is a fix for the seg fault reported in my last email.  The
problem was caused by the fact that there are two global variables that
point to the top of the current file, fileage and open_files->file.  I
think fileage should be removed (that is, open_files would be defined in
all cases, and would just have ->prev == NULL == ->next if
!ENABLE_MULTIBUFFER).  That would generally make the code cleaner.  
Perhaps I will do that soon.



--- nano/cut.c  Fri Feb 15 14:17:02 2002
+++ nano-working/cut.c  Wed Mar 13 11:46:12 2002
@@ -299,6 +299,9 @@
            fileptr = fileptr->next;
            tmp = fileptr;
            fileage = fileptr;
+#ifdef ENABLE_MULTIBUFFER
+            open_files->file = fileptr;
+#endif
            add_to_cutbuffer(fileptr->prev);
            totsize--;          /* get the newline */
            totlines--;



On Wed, 13 Mar 2002, David Benbennick wrote:   <snip>
> Of course, if you want to read a file to the current buffer, you can
> always: insert the file, cut it, close it, and uncut in the original
> buffer.
> 
> So, I was just checking the previous paragraph, and in fact that doesn't
> work, and causes a seg fault.  I guess the cut buffer was freed when I
> closed the current file buffer!  I will try to fix that now.




reply via email to

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