- /* Replace string in input port and reset stream */
- ans = SCM_CDR (SCM_STREAM (gdb_input_port));
- SCM_SETCHARS (ans, str);
- SCM_SETLENGTH (ans, strlen (str), scm_tc7_string);
- SCM_SETCAR (SCM_STREAM (gdb_input_port), SCM_INUM0);
+ scm_seek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET));
+ scm_puts (str, gdb_input_port);
+ scm_truncate_file (gdb_input_port, SCM_UNDEFINED);
+ scm_seek (gdb_input_port, SCM_INUM0, SCM_MAKINUM (SEEK_SET));