miscellaneous bug fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1303 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
e42df73644
Коммит
2ab03f6896
37
ChangeLog
37
ChangeLog
@ -8,6 +8,43 @@ CVS code -
|
|||||||
complicated for a feature freeze.
|
complicated for a feature freeze.
|
||||||
- Disable VSTOP keystroke. Stops people accidentally locking up
|
- Disable VSTOP keystroke. Stops people accidentally locking up
|
||||||
nano (suggested by David Benbennick).
|
nano (suggested by David Benbennick).
|
||||||
|
- Pluralize messages with ngettext() where needed. (David
|
||||||
|
Benbennick)
|
||||||
|
- Update nano.1 and nano.1.html to show that nano now does an
|
||||||
|
emergency save on receiving SIGHUP or SIGTERM. (DLR)
|
||||||
|
- Don't include "nowrap" in the long options if
|
||||||
|
DISABLE_WRAPPING is defined. (DLR)
|
||||||
|
- files.c:
|
||||||
|
read_file()
|
||||||
|
- Minor efficiency fixes, some of which fit in with the change
|
||||||
|
to ngettext() usage mentioned above. (David Benbennick)
|
||||||
|
do_browser()
|
||||||
|
- Make sure the value of path is mallocstrcpy()ed into retval
|
||||||
|
and not just assigned to it, to avoid memory corruption
|
||||||
|
problems. (DLR)
|
||||||
|
- nano.c:
|
||||||
|
justify_format()
|
||||||
|
- Make sure the double space maintained after sentence-ending
|
||||||
|
punctuation is done when that punctuation is immediately
|
||||||
|
followed by a bracket-type character, so justifying e.g.
|
||||||
|
sentences in parentheses works properly. (David Benbennick)
|
||||||
|
handle_hup()
|
||||||
|
- Renamed handle_hupterm() to show that it now handles SIGTERM
|
||||||
|
as well as SIGHUP. (DLR)
|
||||||
|
signal_init()
|
||||||
|
- Do an emergency save on receiving either SIGHUP or SIGTERM,
|
||||||
|
not just SIGHUP. (David Benbennick)
|
||||||
|
main()
|
||||||
|
- Fix a problem where control key commands were printed
|
||||||
|
literally instead of interpreted after a failed search of a
|
||||||
|
one-line file. (David Benbennick)
|
||||||
|
- proto.h:
|
||||||
|
handle_hup()
|
||||||
|
- Renamed handle_hupterm(); see above for why. (DLR)
|
||||||
|
- winio.c:
|
||||||
|
edit_add()
|
||||||
|
- Fix a potential infinite loop occurring with certain
|
||||||
|
zero-length regexes. (David Benbennick)
|
||||||
|
|
||||||
GNU nano 1.1.11 - 10/01/2002
|
GNU nano 1.1.11 - 10/01/2002
|
||||||
- General:
|
- General:
|
||||||
|
7
color.c
7
color.c
@ -33,13 +33,6 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For each syntax list entry, we go through the list of colors and
|
/* For each syntax list entry, we go through the list of colors and
|
||||||
* assign color pairs. */
|
* assign color pairs. */
|
||||||
void set_colorpairs(void)
|
void set_colorpairs(void)
|
||||||
|
@ -15,7 +15,7 @@ AC_SYS_LARGEFILE
|
|||||||
|
|
||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS(fcntl.h unistd.h termios.h termio.h limits.h getopt.h regex.h)
|
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h termio.h termios.h regex.h unistd.h)
|
||||||
|
|
||||||
dnl options
|
dnl options
|
||||||
AC_ARG_ENABLE(debug,
|
AC_ARG_ENABLE(debug,
|
||||||
|
7
cut.c
7
cut.c
@ -28,13 +28,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int marked_cut; /* Is the cutbuffer from a mark? */
|
static int marked_cut; /* Is the cutbuffer from a mark? */
|
||||||
static filestruct *cutbottom = NULL; /* Pointer to end of cutbuffer */
|
static filestruct *cutbottom = NULL; /* Pointer to end of cutbuffer */
|
||||||
|
|
||||||
|
40
files.c
40
files.c
@ -38,13 +38,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
static int fileformat = 0; /* 0 = *nix, 1 = DOS, 2 = Mac */
|
static int fileformat = 0; /* 0 = *nix, 1 = DOS, 2 = Mac */
|
||||||
#endif
|
#endif
|
||||||
@ -287,19 +280,11 @@ int read_file(FILE *f, const char *filename, int quiet)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Did we even GET a file if we don't already have one? */
|
/* Did we even GET a file if we don't already have one? */
|
||||||
if (totsize == 0 || fileptr == NULL) {
|
if (totsize == 0 || fileptr == NULL)
|
||||||
new_file();
|
new_file();
|
||||||
statusbar(_("Read %d lines"), num_lines);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Did we try to insert a file of 0 bytes? */
|
/* Did we try to insert a file of 0 bytes? */
|
||||||
if (num_lines == 0)
|
if (num_lines != 0) {
|
||||||
{
|
|
||||||
statusbar(_("Read %d lines"), 0);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (current != NULL) {
|
if (current != NULL) {
|
||||||
fileptr->next = current;
|
fileptr->next = current;
|
||||||
current->prev = fileptr;
|
current->prev = fileptr;
|
||||||
@ -310,21 +295,23 @@ int read_file(FILE *f, const char *filename, int quiet)
|
|||||||
filebot = fileptr;
|
filebot = fileptr;
|
||||||
new_magicline();
|
new_magicline();
|
||||||
totsize--;
|
totsize--;
|
||||||
|
|
||||||
/* Update the edit buffer; note that if using multibuffers, a
|
|
||||||
quiet load will update the current open_files entry, while a
|
|
||||||
noisy load will add a new open_files entry */
|
|
||||||
load_file(quiet);
|
load_file(quiet);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
if (fileformat == 2)
|
if (fileformat == 2)
|
||||||
statusbar(_("Read %d lines (Converted from Mac format)"), num_lines);
|
statusbar(ngettext("Read %d line (Converted from Mac format)",
|
||||||
|
"Read %d lines (Converted from Mac format)",
|
||||||
|
num_lines), num_lines);
|
||||||
else if (fileformat == 1)
|
else if (fileformat == 1)
|
||||||
statusbar(_("Read %d lines (Converted from DOS format)"), num_lines);
|
statusbar(ngettext("Read %d line (Converted from DOS format)",
|
||||||
|
"Read %d lines (Converted from DOS format)",
|
||||||
|
num_lines), num_lines);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
statusbar(_("Read %d lines"), num_lines);
|
statusbar(ngettext("Read %d line", "Read %d lines", num_lines),
|
||||||
|
num_lines);
|
||||||
|
|
||||||
totlines += num_lines;
|
totlines += num_lines;
|
||||||
|
|
||||||
@ -1659,7 +1646,8 @@ int write_file(const char *name, int tmp, int append, int nonamechange)
|
|||||||
/* Update originalfilestat to reference the file as it is now. */
|
/* Update originalfilestat to reference the file as it is now. */
|
||||||
stat(filename, &originalfilestat);
|
stat(filename, &originalfilestat);
|
||||||
#endif
|
#endif
|
||||||
statusbar(_("Wrote %d lines"), lineswritten);
|
statusbar(ngettext("Wrote %d line", "Wrote %d lines", lineswritten),
|
||||||
|
lineswritten);
|
||||||
UNSET(MODIFIED);
|
UNSET(MODIFIED);
|
||||||
titlebar(NULL);
|
titlebar(NULL);
|
||||||
}
|
}
|
||||||
@ -2655,7 +2643,7 @@ char *do_browser(const char *inpath)
|
|||||||
free(foo);
|
free(foo);
|
||||||
return do_browser(path);
|
return do_browser(path);
|
||||||
} else {
|
} else {
|
||||||
retval = path;
|
retval = mallocstrcpy(retval, path);
|
||||||
abort = 1;
|
abort = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
7
global.c
7
global.c
@ -27,13 +27,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
|
7
move.c
7
move.c
@ -28,13 +28,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int do_home(void)
|
int do_home(void)
|
||||||
{
|
{
|
||||||
UNSET(KEEP_CUTBUFFER);
|
UNSET(KEEP_CUTBUFFER);
|
||||||
|
8
nano.1
8
nano.1
@ -135,10 +135,10 @@ Enable suspend ability.
|
|||||||
Ignored, for compatibility with Pico.
|
Ignored, for compatibility with Pico.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
\fBnano\fP will try to dump the buffer into an emergency file in some
|
\fBnano\fP will try to dump the buffer into an emergency file in some
|
||||||
cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or runs
|
cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or
|
||||||
out of memory, when it will write the buffer into a file named
|
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||||
"nano.save" if the buffer didn't have a name already, or will add a
|
named "nano.save" if the buffer didn't have a name already, or will add
|
||||||
".save" suffix to the current filename. If an emergency file with that
|
a ".save" suffix to the current filename. If an emergency file with that
|
||||||
name already exists in the current directory, ".save" and a number (e.g.
|
name already exists in the current directory, ".save" and a number (e.g.
|
||||||
".save.1") will be suffixed to the current filename in order to make it
|
".save.1") will be suffixed to the current filename in order to make it
|
||||||
unique. In multibuffer mode, \fBnano\fP will write all the open buffers
|
unique. In multibuffer mode, \fBnano\fP will write all the open buffers
|
||||||
|
12
nano.1.html
12
nano.1.html
@ -3,7 +3,7 @@ Content-type: text/html
|
|||||||
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
||||||
</HEAD><BODY>
|
</HEAD><BODY>
|
||||||
<H1>NANO</H1>
|
<H1>NANO</H1>
|
||||||
Section: User Commands (1)<BR>Updated: July 30, 2002<BR><A HREF="#index">Index</A>
|
Section: User Commands (1)<BR>Updated: October 13, 2002<BR><A HREF="#index">Index</A>
|
||||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||||
|
|
||||||
|
|
||||||
@ -180,10 +180,10 @@ Ignored, for compatibility with Pico.
|
|||||||
<H2>NOTES</H2>
|
<H2>NOTES</H2>
|
||||||
|
|
||||||
<B>nano</B> will try to dump the buffer into an emergency file in some
|
<B>nano</B> will try to dump the buffer into an emergency file in some
|
||||||
cases. Mainly, this will happen if <B>nano</B> receives a SIGHUP or runs
|
cases. Mainly, this will happen if <B>nano</B> receives a SIGHUP or
|
||||||
out of memory, when it will write the buffer into a file named
|
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||||
"nano.save" if the buffer didn't have a name already, or will add a
|
named "nano.save" if the buffer didn't have a name already, or will add
|
||||||
".save" suffix to the current filename. If an emergency file with that
|
a ".save" suffix to the current filename. If an emergency file with that
|
||||||
name already exists in the current directory, ".save" and a number (e.g.
|
name already exists in the current directory, ".save" and a number (e.g.
|
||||||
".save.1") will be suffixed to the current filename in order to make it
|
".save.1") will be suffixed to the current filename in order to make it
|
||||||
unique. In multibuffer mode, <B>nano</B> will write all the open buffers
|
unique. In multibuffer mode, <B>nano</B> will write all the open buffers
|
||||||
@ -235,6 +235,6 @@ used by others).
|
|||||||
This document was created by
|
This document was created by
|
||||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||||
using the manual pages.<BR>
|
using the manual pages.<BR>
|
||||||
Time: 21:12:05 GMT, July 30, 2002
|
Time: 16:04:40 GMT, October 13, 2002
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
46
nano.c
46
nano.c
@ -42,13 +42,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS_H
|
#ifdef HAVE_TERMIOS_H
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1973,16 +1966,34 @@ int justify_format(int changes_allowed, filestruct *line, size_t skip)
|
|||||||
back = line->data + skip;
|
back = line->data + skip;
|
||||||
front = back;
|
front = back;
|
||||||
for (; *front; front++) {
|
for (; *front; front++) {
|
||||||
|
int remove_space = 0;
|
||||||
|
/* Do we want to remove this space? */
|
||||||
|
|
||||||
if (*front == '\t') {
|
if (*front == '\t') {
|
||||||
if (!changes_allowed)
|
if (!changes_allowed)
|
||||||
return 1;
|
return 1;
|
||||||
*front = ' ';
|
*front = ' ';
|
||||||
}
|
}
|
||||||
/* these tests are safe since line->data + skip is not a space */
|
/* these tests are safe since line->data + skip is not a space */
|
||||||
if (*front == ' ' && *(front - 1) == ' ' && *(front - 2) != '.' &&
|
if (*front == ' ' && *(front-1) == ' ') {
|
||||||
*(front - 2) != '!' && *(front - 2) != '?') {
|
const char *brackets = _("'\")}]>");
|
||||||
|
const char *punct = _(".?!");
|
||||||
|
const char *bob = front - 2;
|
||||||
|
|
||||||
|
remove_space = 1;
|
||||||
|
for (bob = front - 2; bob >= line->data + skip; bob--) {
|
||||||
|
if (strchr(punct, *bob) != NULL) {
|
||||||
|
remove_space = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (strchr(brackets, *bob) == NULL)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (remove_space) {
|
||||||
/* Now *front is a space we want to remove. We do that by
|
/* Now *front is a space we want to remove. We do that by
|
||||||
* simply failing to assign it to *back */
|
* simply failing to assign it to *back. */
|
||||||
if (!changes_allowed)
|
if (!changes_allowed)
|
||||||
return 1;
|
return 1;
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
@ -2630,9 +2641,10 @@ void signal_init(void)
|
|||||||
act.sa_handler = SIG_IGN;
|
act.sa_handler = SIG_IGN;
|
||||||
sigaction(SIGINT, &act, NULL);
|
sigaction(SIGINT, &act, NULL);
|
||||||
|
|
||||||
/* Trap SIGHUP cuz we want to write the file out. */
|
/* Trap SIGHUP and SIGTERM cuz we want to write the file out. */
|
||||||
act.sa_handler = handle_hup;
|
act.sa_handler = handle_hupterm;
|
||||||
sigaction(SIGHUP, &act, NULL);
|
sigaction(SIGHUP, &act, NULL);
|
||||||
|
sigaction(SIGTERM, &act, NULL);
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
act.sa_handler = handle_sigwinch;
|
act.sa_handler = handle_sigwinch;
|
||||||
@ -2677,10 +2689,10 @@ void signal_init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handler for SIGHUP */
|
/* Handler for SIGHUP and SIGTERM */
|
||||||
RETSIGTYPE handle_hup(int signal)
|
RETSIGTYPE handle_hupterm(int signal)
|
||||||
{
|
{
|
||||||
die(_("Received SIGHUP"));
|
die(_("Received SIGHUP or SIGTERM"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* What do we do when we catch the suspend signal */
|
/* What do we do when we catch the suspend signal */
|
||||||
@ -2933,7 +2945,9 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
{"tempfile", 0, 0, 't'},
|
{"tempfile", 0, 0, 't'},
|
||||||
{"view", 0, 0, 'v'},
|
{"view", 0, 0, 'v'},
|
||||||
|
#ifndef DISABLE_WRAPPING
|
||||||
{"nowrap", 0, 0, 'w'},
|
{"nowrap", 0, 0, 'w'},
|
||||||
|
#endif
|
||||||
{"nohelp", 0, 0, 'x'},
|
{"nohelp", 0, 0, 'x'},
|
||||||
{"suspend", 0, 0, 'z'},
|
{"suspend", 0, 0, 'z'},
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
@ -3256,7 +3270,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
#ifndef DISABLE_MOUSE
|
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE) || !defined(DISABLE_HELP)
|
||||||
currshortcut = main_list;
|
currshortcut = main_list;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
10
nano.h
10
nano.h
@ -46,8 +46,14 @@
|
|||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif /* CURSES_H */
|
#endif /* CURSES_H */
|
||||||
|
|
||||||
#ifdef HAVE_LIBINTL_H
|
#ifdef ENABLE_NLS
|
||||||
#include <libintl.h>
|
# ifdef HAVE_LIBINTL_H
|
||||||
|
# include <libintl.h>
|
||||||
|
# endif
|
||||||
|
# define _(string) gettext(string)
|
||||||
|
#else
|
||||||
|
# define _(string) (string)
|
||||||
|
# define ngettext(singular, plural, number) number == 1 ? singular : plural
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
2
proto.h
2
proto.h
@ -290,7 +290,7 @@ int break_line(const char *line, int goal, int force);
|
|||||||
int do_justify(void);
|
int do_justify(void);
|
||||||
int do_exit(void);
|
int do_exit(void);
|
||||||
void signal_init(void);
|
void signal_init(void);
|
||||||
RETSIGTYPE handle_hup(int signal);
|
RETSIGTYPE handle_hupterm(int signal);
|
||||||
RETSIGTYPE do_suspend(int signal);
|
RETSIGTYPE do_suspend(int signal);
|
||||||
RETSIGTYPE do_cont(int signal);
|
RETSIGTYPE do_cont(int signal);
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
|
7
rcfile.c
7
rcfile.c
@ -37,13 +37,6 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_NANORC
|
#ifdef ENABLE_NANORC
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const static rcoption rcopts[] = {
|
const static rcoption rcopts[] = {
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
{"autoindent", AUTOINDENT},
|
{"autoindent", AUTOINDENT},
|
||||||
|
7
search.c
7
search.c
@ -30,13 +30,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Regular expression helper functions */
|
/* Regular expression helper functions */
|
||||||
|
|
||||||
#ifdef HAVE_REGEX_H
|
#ifdef HAVE_REGEX_H
|
||||||
|
7
utils.c
7
utils.c
@ -30,13 +30,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int is_cntrl_char(int c)
|
int is_cntrl_char(int c)
|
||||||
{
|
{
|
||||||
if (iscntrl(c) || ((c & 127) != 127 && iscntrl(c & 127)))
|
if (iscntrl(c) || ((c & 127) != 127 && iscntrl(c & 127)))
|
||||||
|
12
winio.c
12
winio.c
@ -30,13 +30,6 @@
|
|||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
|
||||||
#include <libintl.h>
|
|
||||||
#define _(string) gettext(string)
|
|
||||||
#else
|
|
||||||
#define _(string) (string)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int statblank = 0; /* Number of keystrokes left after
|
static int statblank = 0; /* Number of keystrokes left after
|
||||||
we call statusbar(), before we
|
we call statusbar(), before we
|
||||||
actually blank the statusbar */
|
actually blank the statusbar */
|
||||||
@ -655,9 +648,10 @@ void edit_add(const filestruct *fileptr, int yval, int start
|
|||||||
/* Translate the match to the beginning of the line. */
|
/* Translate the match to the beginning of the line. */
|
||||||
startmatch.rm_so += k;
|
startmatch.rm_so += k;
|
||||||
startmatch.rm_eo += k;
|
startmatch.rm_eo += k;
|
||||||
if (startmatch.rm_so == startmatch.rm_eo)
|
if (startmatch.rm_so == startmatch.rm_eo) {
|
||||||
|
startmatch.rm_eo++;
|
||||||
statusbar(_("Refusing 0 length regex match"));
|
statusbar(_("Refusing 0 length regex match"));
|
||||||
else if (startmatch.rm_so < start + COLS &&
|
} else if (startmatch.rm_so < start + COLS &&
|
||||||
startmatch.rm_eo > start) {
|
startmatch.rm_eo > start) {
|
||||||
x_start = startmatch.rm_so - start;
|
x_start = startmatch.rm_so - start;
|
||||||
if (x_start < 0)
|
if (x_start < 0)
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user