Applied patch #5611
[pspp-builds.git] / src / libpspp / message.c
index 24bb8e874ba10d77dd29cf76e168af795cfaee8a..31a78d25e09d358e6250cc8200e14eb91701829d 100644 (file)
@@ -63,9 +63,12 @@ msg (enum msg_class class, const char *format, ...)
   msg_emit (&m);
 }
 
+static struct source_stream *s_stream;
+
 void
-msg_init ( void (*handler) (const struct msg *) )
+msg_init (struct source_stream *ss,  void (*handler) (const struct msg *) )
 {
+  s_stream = ss;
   msg_handler = handler;
 }
 
@@ -99,7 +102,7 @@ msg_destroy(struct msg *m)
 void
 msg_emit (struct msg *m) 
 {
-  get_msg_location (&m->where);
+  get_msg_location (s_stream, &m->where);
   if (!messages_disabled)
     msg_handler (m);
   free (m->text);