guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-137-g75321


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-137-g7532125
Date: Tue, 10 Jan 2012 11:33:50 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=7532125912a381c0770aa7af596b7401942c685b

The branch, stable-2.0 has been updated
       via  7532125912a381c0770aa7af596b7401942c685b (commit)
      from  3248c954dbd67a2abb67ffbc470feaeb8c8dd0d3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7532125912a381c0770aa7af596b7401942c685b
Author: Mark H Weaver <address@hidden>
Date:   Tue Jan 10 06:18:31 2012 -0500

    Avoid calling `u32_conv_from_encoding' on the null string
    
    * libguile/strings.c (scm_from_stringn): Avoid calling
      `u32_conv_from_encoding' on the null string, by using the same
      fast-path code used if (encoding == NULL).  This is an optimization,
      and also avoids any possible encoding errors.

-----------------------------------------------------------------------

Summary of changes:
 libguile/strings.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libguile/strings.c b/libguile/strings.c
index 73c0a5c..c94a200 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1473,9 +1473,9 @@ scm_from_stringn (const char *str, size_t len, const char 
*encoding,
   if (len == (size_t) -1)
     len = strlen (str);
 
-  if (encoding == NULL)
+  if (encoding == NULL || len == 0)
     {
-      /* If encoding is null, use Latin-1.  */
+      /* If encoding is null (or the string is empty), use Latin-1.  */
       char *buf;
       res = scm_i_make_string (len, &buf, 0);
       memcpy (buf, str, len);


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]