From da50e73c40a140277c72a560442d7b5414adbd08 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 4 Jul 2005 04:22:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 15 +++++++++++---- configure.ac | 10 +++++----- src/nano.h | 9 ++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 165b1bac..5b8b4c84 100644 --- 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 index 5faed881..20de1fbd 100644 --- 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 index e9ee3c4e..97fd73b8 100644 --- a/src/nano.h +++ b/src/nano.h @@ -93,16 +93,11 @@ #include #include -/* If no snprintf() or vsnprintf(), use the versions from glib 2.x. */ -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) -#include -#ifndef HAVE_SNPRINTF -#define snprintf g_snprintf -#endif +/* If no vsnprintf(), use the version from glib 2.x. */ #ifndef HAVE_VSNPRINTF +#include #define vsnprintf g_vsnprintf #endif -#endif /* If no isblank(), iswblank(), strcasecmp(), strncasecmp(), * strcasestr(), strnlen(), getdelim(), or getline(), use the versions -- 2.39.5