sure the cursor position is displayed properly. (DLR)
do_alt_speller()
- If we can't invoke the spell checker, use sprintf() instead of
- snprintf() to write the error string we return, as
- altspell_error will always be long enough to hold it. Also
- remove unnecessary initialization of altspell_error, and
- refactor so that msglen is no longer needed. (DLR)
+ snprintf() to write the error string we return, as the one
+ formatted value is a simple string, and so altspell_error will
+ always be long enough to hold it. Also remove unnecessary
+ initialization of altspell_error, and refactor so that msglen
+ is no longer needed. (DLR)
allow_pending_sigwinch()
- Simplify by using the "?" operator instead of an if clause.
(DLR)
- When constant cursor position display is on, only display the
cursor position if there are no keys waiting in the buffer.
(DLR)
+- nano.h:
+ - Since we only use vsnprintf() now, remove the #ifdef block for
+ HAVE_SNPRINTF. (DLR)
- search.c:
search_init()
- Don't blank out last_replace anymore when we get a new string,
do_replace()
- Blank out last_replace properly again just before displaying
the "Replace" prompt. (DLR, found by Mike Frysinger)
+ configure.ac:
+ - Since we only use vsnprintf() now, remove the tests for
+ snprintf(). (DLR)
doc/nanorc.sample:
- Add regexes for Bourne shell scripts. (Mike Frysinger, minor
tweaks by DLR)
dnl Checks for functions.
-AC_CHECK_FUNCS(getdelim getline isblank snprintf strcasecmp strcasestr strncasecmp strnlen vsnprintf)
+AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
if test x$enable_utf8 != xno; then
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth)
fi
-if test x$ac_cv_func_snprintf = xno || test x$ac_cv_func_vsnprintf = xno; then
+if test x$ac_cv_func_vsnprintf = xno; then
AM_PATH_GLIB_2_0(2.0.0,,
AC_MSG_ERROR([
-*** snprintf() and/or vsnprintf() not found. GLIB 2.x not found either.
-*** You need both snprintf() and vsnprintf(). Alternatively you can
-*** install the GLIB library which can be found at ftp://ftp.gtk.org/.]),
+*** vsnprintf() not found. GLIB 2.x not found either. You should
+*** install the GLIB 2.x library which can be found at
+*** ftp://ftp.gtk.org/.]),
glib)
fi
#include <sys/types.h>
#include <sys/stat.h>
-/* If no snprintf() or vsnprintf(), use the versions from glib 2.x. */
-#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
-#include <glib.h>
-#ifndef HAVE_SNPRINTF
-#define snprintf g_snprintf
-#endif
+/* If no vsnprintf(), use the version from glib 2.x. */
#ifndef HAVE_VSNPRINTF
+#include <glib.h>
#define vsnprintf g_vsnprintf
#endif
-#endif
/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
* strcasestr(), strnlen(), getdelim(), or getline(), use the versions