message: Intern file names in msg_location to make them cheaper to copy.
[pspp] / src / language / control / define.c
index 4c12ac24935badc7cf8c9b2408a2065cb8996d46..f33e885925a807b67071d1832b2de8442f3c7845 100644 (file)
@@ -23,6 +23,7 @@
 #include "language/lexer/macro.h"
 #include "language/lexer/scan.h"
 #include "language/lexer/token.h"
+#include "libpspp/intern.h"
 #include "libpspp/message.h"
 
 #include "gl/xalloc.h"
@@ -113,7 +114,7 @@ cmd_define (struct lexer *lexer, struct dataset *ds UNUSED)
     .location = xmalloc (sizeof *m->location),
   };
   *m->location = (struct msg_location) {
-    .file_name = xstrdup_if_nonnull (lex_get_file_name (lexer)),
+    .file_name = intern_new_if_nonnull (lex_get_file_name (lexer)),
     .first_line = lex_get_first_line_number (lexer, 0),
   };
   lex_get (lexer);