(display_frame_expr): Do not remove control characters from the final
authorMarius Vollmer <mvo@zagadka.de>
Wed, 29 Sep 2004 17:40:11 +0000 (17:40 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Wed, 29 Sep 2004 17:40:11 +0000 (17:40 +0000)
string.  Print it directly using scm_display.

libguile/backtrace.c

index 28f7d8a..3507b27 100644 (file)
@@ -374,7 +374,6 @@ indent (int n, SCM port)
 static void
 display_frame_expr (char *hdr, SCM exp, char *tlr, int indentation, SCM sport, SCM port, scm_print_state *pstate)
 {
-  SCM string;
   int i = 0, n;
   scm_t_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (sport);
   do
@@ -398,28 +397,8 @@ display_frame_expr (char *hdr, SCM exp, char *tlr, int indentation, SCM sport, S
     }
   while (indentation + n > SCM_BACKTRACE_WIDTH && i < n_print_params);
   ptob->truncate (sport, n);
-  string = scm_strport_to_string (sport);
-  assert (scm_is_string (string));
-
-  {
-    char *data = scm_i_string_writable_chars (string);
-
-    /* Remove control characters */
-    for (i = 0; i < n; ++i)
-      if (iscntrl (data[i]))
-       data[i] = ' ';
-    /* Truncate */
-    if (indentation + n > SCM_BACKTRACE_WIDTH)
-      {
-       n = SCM_BACKTRACE_WIDTH - indentation;
-       data[n-1] = '$';
-      }
-
-    scm_i_string_stop_writing ();
-  }
       
-  scm_lfwrite (scm_i_string_chars (string), n, port);
-  scm_remember_upto_here_1 (string);
+  scm_display (scm_strport_to_string (sport), port);
 }
 
 static void