working
[pspp] / src / libpspp / message.c
index 526e19f3a016619dbd948c1f0c111db22bc3140e..9ead3efb3f953773441a4fd8baf48973d1a436a9 100644 (file)
@@ -151,12 +151,18 @@ msg_point_compare_3way (const struct msg_point *a, const struct msg_point *b)
 void
 msg_location_merge (struct msg_location **dstp, const struct msg_location *src)
 {
+  struct msg_location *dst = *dstp;
+  if (!dst)
+    {
+      *dstp = msg_location_dup (src);
+      return;
+    }
+
   if (dst->file_name != src->file_name)
     {
       /* Failure. */
       return;
     }
-
   if (msg_point_compare_3way (&dst->p[0], &src->p[0]) > 0)
     dst->p[0] = src->p[0];
   if (msg_point_compare_3way (&dst->p[1], &src->p[1]) < 0)