- read_buf has been advanced to read_pos - 1,
- so that scm_ftell returns 1, instead of #parsed chars
- */
-
- /*
- urg: reset read_buf for scm_ftell
- shouldn't scm_read () do this for us?
- */
+ SCM answer = SCM_UNSPECIFIED;
+ SCM form = scm_read (port);
+
+ /* Read expression from port. */
+ if (!SCM_EOF_OBJECT_P (form))
+ {
+ if (ps->safe_)
+ {
+ static SCM module = SCM_BOOL_F;
+ if (module == SCM_BOOL_F)
+ {
+ SCM function = ly_lily_module_constant ("make-safe-lilypond-module");
+ module = scm_call_0 (function);
+ }
+ answer = scm_eval (form, module);
+ }
+ else
+ answer = scm_primitive_eval (form);
+ }
+
+ /* Reset read_buf for scm_ftell.
+ Shouldn't scm_read () do this for us? */