+ if (line_for_sending == NULL) {
+ line_for_sending = strdup (line);
+ }
+ else {
+ line_for_sending = realloc (line_for_sending, strlen (line_for_sending) + strlen (line) + 2);
+ line_for_sending = strcat (line_for_sending, " ");
+ line_for_sending = strcat (line_for_sending, line);
+ }
+
+ if (opened <= 0) {
+ scm_write (scm_from_locale_string (line_for_sending), send_channel);
+ scm_force_output (send_channel);
+ free (line_for_sending);
+ line_for_sending = NULL;
+
+ while (scm_char_ready_p (rec_channel) == SCM_BOOL_F) {
+ if (ctrl_c) break;
+ sleep (0.5);
+ }
+ if (ctrl_c)
+ ctrl_c = 0;
+ else {
+ buffer = scm_read (rec_channel);
+ if (strlen (scm_to_locale_string (buffer)) > 0)
+ printf ("%s\n", scm_to_locale_string (buffer));
+ }
+ }