DLR's patch

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2002-03-28 01:59:34 +00:00
parent 7afc6d9468
commit 2598c66d81
7 changed files with 31 additions and 14 deletions

View File

@ -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:

4
cut.c
View File

@ -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();

20
files.c
View File

@ -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;
}

View File

@ -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)

View File

@ -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]"

View File

@ -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"

View File

@ -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 {