guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 15/19: Merge commit '5943a62042432b86d757200ef595d7aebb5


From: Andy Wingo
Subject: [Guile-commits] 15/19: Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac'
Date: Thu, 22 Jan 2015 13:54:49 +0000

wingo pushed a commit to branch master
in repository guile.

commit 1cd779140dd74ddfaa62032882cb4745c2302cee
Merge: baa74d3 5943a62
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 22 14:38:00 2015 +0100

    Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac'

 libguile/print.c |   76 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 51 insertions(+), 25 deletions(-)

diff --cc libguile/print.c
index 0a2067f,86e0a03..d950511
--- a/libguile/print.c
+++ b/libguile/print.c
@@@ -701,27 -636,20 +704,23 @@@ iprin1 (SCM exp, SCM port, scm_print_st
              break;
            }
          break;
 +        case scm_tc7_stringbuf:
 +          scm_i_print_stringbuf (exp, port, pstate);
 +          break;
          case scm_tc7_string:
-           if (SCM_WRITINGP (pstate))
-             {
-               size_t len, i;
- 
-               display_character ('"', port, iconveh_question_mark);
-               len = scm_i_string_length (exp);
-               for (i = 0; i < len; ++i)
-               write_character (scm_i_string_ref (exp, i), port, 1);
- 
-               display_character ('"', port, iconveh_question_mark);
-               scm_remember_upto_here_1 (exp);
-             }
-           else
-           {
-             size_t len, printed;
+         {
+           size_t len, printed;
  
-             len = scm_i_string_length (exp);
+           len = scm_i_string_length (exp);
+           if (SCM_WRITINGP (pstate))
+             {
+               printed = write_string (scm_i_string_data (exp),
+                                       scm_i_is_narrow_string (exp),
+                                       len, port,
+                                       PORT_CONVERSION_HANDLER (port));
+               len += 2;                   /* account for the quotes */
+             }
+           else
              printed = display_string (scm_i_string_data (exp),
                                        scm_i_is_narrow_string (exp),
                                        len, port,
@@@ -1143,14 -1068,13 +1141,14 @@@ display_string (const void *str, int na
  
    if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8)
      return display_string_as_utf8 (str, narrow_p, len, port);
 +  else if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_LATIN1)
 +    return display_string_as_latin1 (str, narrow_p, len, port, strategy);
    else
 -    return display_string_using_iconv (str, narrow_p, len,
 -                                     port, strategy);
 +    return display_string_using_iconv (str, narrow_p, len, port, strategy);
  }
  
- /* Attempt to display CH to PORT according to STRATEGY.  Return non-zero
-    if CH was successfully displayed, zero otherwise (e.g., if it was not
+ /* Attempt to display CH to PORT according to STRATEGY.  Return one if
+    CH was successfully displayed, zero otherwise (e.g., if it was not
     representable in PORT's encoding.)  */
  static int
  display_character (scm_t_wchar ch, SCM port,



reply via email to

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