commit da50e73c40a140277c72a560442d7b5414adbd08
parent e927ce59d13620e8c3455e688d02544ec0767d46
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 4 Jul 2005 04:22:30 +0000
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
Diffstat:
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -7,10 +7,11 @@ CVS code -
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)
@@ -18,6 +19,9 @@ CVS code -
- 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,
@@ -29,6 +33,9 @@ CVS code -
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)
diff --git a/configure.ac b/configure.ac
@@ -398,18 +398,18 @@ int main(void)
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
diff --git a/src/nano.h b/src/nano.h
@@ -93,16 +93,11 @@
#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