From 2598c66d8112935b25d11cf1ff53441d38e5e67f Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Thu, 28 Mar 2002 01:59:34 +0000 Subject: [PATCH] DLR's patch git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 8 ++++++++ cut.c | 4 ++++ files.c | 20 +++++++++++--------- global.c | 2 +- po/es.po | 2 +- po/it.po | 2 +- winio.c | 7 +++++-- 7 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3cc2210..f7700f27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,11 +11,14 @@ CVS code - - files.c: check_writable_directory() - Stat full_path, not path (Steven Kneizys). + open_pipe() + - I18nize the pipe error (DLR). read_file() - Abort if we read a file of 0 lines (num_lines == 0), fixes BUG #70. - Reverse tests to stop segfault on editing a new file of 0 lines (David Benbennick) - Change input var to one char instead of array (David Benbennick). + - Move NO_CONVERT check up so chars get read in properly (DLR). - nano.c: do_justify() - More fixes for indented justify (David Benbennick). @@ -48,14 +51,19 @@ CVS code - - winio.c: do_credits() - Add Thomas Dickey. + update_line(), xpt() + - Add check for 127 (DLR). - po/sv.po: - Swedish translation updates (Christian Rose). - po/de.po: - German translation updates (Michael Piefel). - po/id.po: - Indonesian translation updates (Tedi Heriyanto). +- po/it.po: + - Serious typo (DLR). - po/ca.po, po/es.po: - Catalan and Spanish translation updates (Jordi). + - Typo (DLR). - po/fr.po: - French translation updates (Jean-Philippe Guérard). - po/gl.po: diff --git a/cut.c b/cut.c index c2f1d690..edd74f4d 100644 --- a/cut.c +++ b/cut.c @@ -382,6 +382,10 @@ int do_uncut_text(void) 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 --git a/files.c b/files.c index ee07078d..b94838da 100644 --- a/files.c +++ b/files.c @@ -197,22 +197,24 @@ int read_file(int fd, char *filename, int quiet) /* 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 @@ int open_pipe(char *command) /* Make our pipes. */ if (pipe(fd) == -1) { - statusbar("Could not pipe"); + statusbar(_("Could not pipe")); return 1; } diff --git a/global.c b/global.c index 7739fe8b..06d88f48 100644 --- a/global.c +++ b/global.c @@ -753,7 +753,7 @@ void thanks_for_all_the_fish(void) filestruct * current_open_file; #endif -#ifdef ENABLE_MULTIBUFFER +#ifndef DISABLE_OPERATINGDIR if (operating_dir != NULL) free(operating_dir); if (full_operating_dir != NULL) diff --git a/po/es.po b/po/es.po index 0baba67f..ed3f1a62 100644 --- a/po/es.po +++ b/po/es.po @@ -155,7 +155,7 @@ msgstr "%d l #: files.c:1414 msgid " [Mac Format]" -msgstr " [Formatp Mac]" +msgstr " [Formato Mac]" #: files.c:1416 msgid " [DOS Format]" diff --git a/po/it.po b/po/it.po index e1ae2d0e..7d9c2a48 100644 --- a/po/it.po +++ b/po/it.po @@ -902,7 +902,7 @@ msgstr "Controllo ortografico fallito" #: nano.c:1758 msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? " -msgstr ""Salva il buffer modificato? (RISPONDENDO \"No\" ANNULLERETE I CAMBIAMENTI AVVENUTI) " +msgstr "Salva il buffer modificato? (RISPONDENDO \"No\" ANNULLERETE I CAMBIAMENTI AVVENUTI) " #: nano.c:1913 msgid "Received SIGHUP" diff --git a/winio.c b/winio.c index e4fdca9c..1168e9e2 100644 --- a/winio.c +++ b/winio.c @@ -84,7 +84,7 @@ int xpt(filestruct * fileptr, int index) } 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 @@ void update_line(filestruct * fileptr, int index) 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 { -- 2.39.5