Commit da50e73c authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

with the removal of the last snprintf(), we now only use vsnprintf(), so

remove snprintf()-related #ifdefs and checks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2815 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 18 additions and 16 deletions
+18 -16
...@@ -7,10 +7,11 @@ CVS code - ...@@ -7,10 +7,11 @@ CVS code -
sure the cursor position is displayed properly. (DLR) sure the cursor position is displayed properly. (DLR)
do_alt_speller() do_alt_speller()
- If we can't invoke the spell checker, use sprintf() instead of - If we can't invoke the spell checker, use sprintf() instead of
snprintf() to write the error string we return, as snprintf() to write the error string we return, as the one
altspell_error will always be long enough to hold it. Also formatted value is a simple string, and so altspell_error will
remove unnecessary initialization of altspell_error, and always be long enough to hold it. Also remove unnecessary
refactor so that msglen is no longer needed. (DLR) initialization of altspell_error, and refactor so that msglen
is no longer needed. (DLR)
allow_pending_sigwinch() allow_pending_sigwinch()
- Simplify by using the "?" operator instead of an if clause. - Simplify by using the "?" operator instead of an if clause.
(DLR) (DLR)
...@@ -18,6 +19,9 @@ CVS code - ...@@ -18,6 +19,9 @@ CVS code -
- When constant cursor position display is on, only display the - When constant cursor position display is on, only display the
cursor position if there are no keys waiting in the buffer. cursor position if there are no keys waiting in the buffer.
(DLR) (DLR)
- nano.h:
- Since we only use vsnprintf() now, remove the #ifdef block for
HAVE_SNPRINTF. (DLR)
- search.c: - search.c:
search_init() search_init()
- Don't blank out last_replace anymore when we get a new string, - Don't blank out last_replace anymore when we get a new string,
...@@ -29,6 +33,9 @@ CVS code - ...@@ -29,6 +33,9 @@ CVS code -
do_replace() do_replace()
- Blank out last_replace properly again just before displaying - Blank out last_replace properly again just before displaying
the "Replace" prompt. (DLR, found by Mike Frysinger) 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: doc/nanorc.sample:
- Add regexes for Bourne shell scripts. (Mike Frysinger, minor - Add regexes for Bourne shell scripts. (Mike Frysinger, minor
tweaks by DLR) tweaks by DLR)
......
...@@ -398,18 +398,18 @@ int main(void) ...@@ -398,18 +398,18 @@ int main(void)
dnl Checks for functions. 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 if test x$enable_utf8 != xno; then
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth) AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth)
fi 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,, AM_PATH_GLIB_2_0(2.0.0,,
AC_MSG_ERROR([ AC_MSG_ERROR([
*** snprintf() and/or vsnprintf() not found. GLIB 2.x not found either. *** vsnprintf() not found. GLIB 2.x not found either. You should
*** You need both snprintf() and vsnprintf(). Alternatively you can *** install the GLIB 2.x library which can be found at
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.]), *** ftp://ftp.gtk.org/.]),
glib) glib)
fi fi
......
...@@ -93,16 +93,11 @@ ...@@ -93,16 +93,11 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
/* If no snprintf() or vsnprintf(), use the versions from glib 2.x. */ /* If no vsnprintf(), use the version from glib 2.x. */
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <glib.h>
#ifndef HAVE_SNPRINTF
#define snprintf g_snprintf
#endif
#ifndef HAVE_VSNPRINTF #ifndef HAVE_VSNPRINTF
#include <glib.h>
#define vsnprintf g_vsnprintf #define vsnprintf g_vsnprintf
#endif #endif
#endif
/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(), /* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
* strcasestr(), strnlen(), getdelim(), or getline(), use the versions * strcasestr(), strnlen(), getdelim(), or getline(), use the versions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment