From 82a411077ab19b4eec264748a7f2f649ec1b1cb6 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Thu, 29 May 2014 18:30:23 +0000 Subject: [PATCH] 2014-05-29 Chris Allegretta * src/chars.c (addstrings): Needs to be available even on non-utf-8 sustems. * nano-regress: Added --disable-utf8 to regression check git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4933 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ nano-regress | 2 +- src/chars.c | 23 ++++++++++++----------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a48a4730..2ba81a39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-05-29 Chris Allegretta + * src/chars.c (addstrings): Needs to be available even on + non-utf-8 sustems. + * nano-regress: Added --disable-utf8 to regression check + 2014-05-28 Chris Allegretta * doc/syntax/mutt.nanorc: Include Benno's awesome signature matcher, modified slightly to also work for quoted sigs. diff --git a/nano-regress b/nano-regress index c7329256..9c121ccd 100755 --- a/nano-regress +++ b/nano-regress @@ -8,7 +8,7 @@ sub combinations { return @rest, map { [$first, @$_] } @rest; } -my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-browser --disable-help --disable-mouse --disable-operatingdir --disable-speller", "--disable-multibuffer", "--disable-nanorc", "--with-slang"); +my @allargs=("--enable-debug", "--disable-wrapping", "--disable-justify", "--disable-extra", "--enable-tiny", "--disable-utf8", "--disable-multibuffer", "--disable-nanorc", "--with-slang"); my @combos = combinations(@allargs); my $i = 0; diff --git a/src/chars.c b/src/chars.c index 65c340eb..414c47bd 100644 --- a/src/chars.c +++ b/src/chars.c @@ -43,17 +43,6 @@ static const wchar_t bad_wchar = 0xFFFD; static const char *const bad_mbchar = "\xEF\xBF\xBD"; static const int bad_mbchar_len = 3; -/* Concatenate two allocated strings. */ -char* addstrings(char* str1, size_t len1, char* str2, size_t len2) -{ - str1 = charealloc(str1, len1 + len2 + 1); - str1[len1] = '\0'; - strncat(&str1[len1], str2, len2); - free(str2); - - return str1; -} - /* Enable UTF-8 support. */ void utf8_init(void) { @@ -67,6 +56,18 @@ bool using_utf8(void) } #endif /* ENABLE_UTF8 */ +/* Concatenate two allocated strings. */ +char* addstrings(char* str1, size_t len1, char* str2, size_t len2) +{ + str1 = charealloc(str1, len1 + len2 + 1); + str1[len1] = '\0'; + strncat(&str1[len1], str2, len2); + free(str2); + + return str1; +} + + #ifndef HAVE_ISBLANK /* This function is equivalent to isblank(). */ bool nisblank(int c) -- 2.39.5