nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] fix for BTS bug, etc.


From: David Lawrence Ramsey
Subject: [Nano-devel] fix for BTS bug, etc.
Date: Wed, 27 Mar 2002 07:56:46 -0800 (PST)

I got a little bit of time to hack on nano this morning.
The attached patch fixes the bug most recently reported from
the Debian BTS (when a binary character was detected,
NO_CONVERT was set, but the character was not subsequently
read in), and a bug where ASCII 127 (^?) was not handled
properly as a control character (for some reason, even though
nothing special is done when it's detected in update_line(),
it's still displayed as ^?; I put a check for it in
explicitly; I don't know if that's redundant or not, but it
seems to work so far).

The uncutting with cut-to-end fix has also been backported
from the nanopieces.patch to plain 1.1.7-cvs (and fixed in
the process; the magicline would not be added if uncutting
was done on the last line, whether or not the buffer was
blank), as has David Benbennick's fixing of an erroneous
#ifdef.

Some minor translation fixes from nanopieces.patch have
also been backported: the typo fix for es.po, and the
translation ( _() ) of the string "Could not pipe" in
open_pipe() in files.c (actually, this last item should
have been in nanopieces.patch, but isn't).


_____________________________________________________________
Sluggy.Net: The Sluggy Freelance Community!

_____________________________________________________________
Run a small business? Then you need professional email like address@hidden from 
Everyone.net  http://www.everyone.net?tag
diff -urN nano-1.1.7-cvs/cut.c nano-1.1.7-cvs-fixed/cut.c
--- nano-1.1.7-cvs/cut.c        Fri Feb 15 14:17:02 2002
+++ nano-1.1.7-cvs-fixed/cut.c  Wed Mar 27 08:36:25 2002
@@ -382,6 +382,10 @@
            totsize += strlen(cutbuffer->data);
            if (strlen(cutbuffer->data) == 0)
                totlines++;
+           /* If we've uncut a line, make sure there's a magicline after
+              it */
+           if (current->next == NULL)
+               new_magicline();
 
            placewewant = xplustabs();
            update_cursor();
diff -urN nano-1.1.7-cvs/files.c nano-1.1.7-cvs-fixed/files.c
--- nano-1.1.7-cvs/files.c      Tue Mar 26 08:05:54 2002
+++ nano-1.1.7-cvs-fixed/files.c        Wed Mar 27 08:37:24 2002
@@ -197,22 +197,24 @@
     /* Read the entire file into file struct */
     while ((size = read_byte(fd, filename, &input)) > 0) {
 
+#ifndef NANO_SMALL
+       if (!ISSET(NO_CONVERT) && input >= 0 && input <= 31
+               && input != 127 && input != '\t' && input != '\r'
+               && input != '\n')
+       /* If the file has binary chars in it, don't stupidly
+          assume it's a DOS or Mac formatted file! */
+       SET(NO_CONVERT);
+#endif
+
        if (input == '\n') {
            fileptr = read_line(buf, fileptr, &line1ins);
            num_lines++;
            buf[0] = 0;
            i = 0;
 #ifndef NANO_SMALL
-        } else if (!ISSET(NO_CONVERT) && input >= 0 && input <= 31 
-                       && input != '\t' && input != '\r'
-                       && input != '\n') 
-           /* If the file has binary chars in it, don't stupidly
-               assume it's a DOS or Mac formatted file! */
-           SET(NO_CONVERT);
-
        /* If it's a Mac file (no LF just a CR), and file conversion
           isn't disabled, handle it! */
-       else if (!ISSET(NO_CONVERT) && i > 0 && buf[i-1] == '\r') {
+       } else if (!ISSET(NO_CONVERT) && i > 0 && buf[i-1] == '\r') {
            fileformat = 2;
            fileptr = read_line(buf, fileptr, &line1ins);
            num_lines++;
@@ -299,7 +301,7 @@
   /* Make our pipes. */
 
     if (pipe(fd) == -1) {
-       statusbar("Could not pipe");
+       statusbar(_("Could not pipe"));
        return 1;
     }
 
diff -urN nano-1.1.7-cvs/global.c nano-1.1.7-cvs-fixed/global.c
--- nano-1.1.7-cvs/global.c     Sun Mar 24 18:20:32 2002
+++ nano-1.1.7-cvs-fixed/global.c       Wed Mar 27 08:41:46 2002
@@ -753,7 +753,7 @@
     filestruct * current_open_file;
 #endif
 
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_OPERATINGDIR
     if (operating_dir != NULL)
        free(operating_dir);
     if (full_operating_dir != NULL)
diff -urN nano-1.1.7-cvs/po/es.po nano-1.1.7-cvs-fixed/po/es.po
--- nano-1.1.7-cvs/po/es.po     Tue Mar 12 12:23:08 2002
+++ nano-1.1.7-cvs-fixed/po/es.po       Wed Mar 27 08:35:48 2002
@@ -155,7 +155,7 @@
 
 #: files.c:1414
 msgid " [Mac Format]"
-msgstr " [Formatp Mac]"
+msgstr " [Formato Mac]"
 
 #: files.c:1416
 msgid " [DOS Format]"
diff -urN nano-1.1.7-cvs/winio.c nano-1.1.7-cvs-fixed/winio.c
--- nano-1.1.7-cvs/winio.c      Sun Mar 24 18:19:32 2002
+++ nano-1.1.7-cvs-fixed/winio.c        Wed Mar 27 08:36:25 2002
@@ -84,7 +84,7 @@
        } else if (fileptr->data[i] & 0x80)
            /* Make 8 bit chars only 1 column! */
            ;
-       else if (fileptr->data[i] < 32)
+       else if (fileptr->data[i] < 32 || fileptr->data[i] == 127)
            tabs++;
     }
 
@@ -1140,8 +1140,11 @@
                virt_cur_x--;
            if (i < mark_beginx)
                virt_mark_beginx--;
+       } else if (realdata[i] == 127) {
+           /* Treat control characters as ^symbol (ASCII 1 - 31, 127) */
+           fileptr->data[pos++] = '^';
+           fileptr->data[pos++] = '?';
        } else if (realdata[i] >= 1 && realdata[i] <= 31) {
-           /* Treat control characters as ^letter */
            fileptr->data[pos++] = '^';
            fileptr->data[pos++] = realdata[i] + 64;
        } else {

reply via email to

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