In most cases, msg_emit() initialized the "where" member of the message
passed in. However, if msg_init() had not yet been called, it did not do
this. This fixes that corner case.
In addition, one caller of msg_emit() did not initialize these members. It
is not necessary for both msg_emit() and its callers to do so, but since
most callers did so, this commit simply makes the remaining caller do so
as well, for consistency.
m.category = MSG_DATA;
m.severity = MSG_WARNING;
m.text = ds_cstr (&text);
+ m.where.file_name = NULL;
+ m.where.line_number = -1;
msg_emit (&m);
}
{
if ( s_stream )
get_msg_location (s_stream, &m->where);
+ else
+ {
+ m->where.file_name = NULL;
+ m->where.line_number = -1;
+ }
if (!messages_disabled)
msg_handler (m);