Continue reforming procedure execution. In this phase, get rid of
[pspp-builds.git] / src / language / control / repeat.c
index bba14c6c7bdb3c1bd6febb6a50a99498a0f9d152..ec37382b56caa0f27bc5a93273458233f259c3ba 100644 (file)
    02110-1301, USA. */
 
 #include <config.h>
+
 #include "repeat.h"
-#include "message.h"
+
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
-#include "alloc.h"
-#include "command.h"
-#include "dictionary.h"
-#include "message.h"
-#include "line-buffer.h"
-#include "lexer.h"
-#include "misc.h"
-#include "pool.h"
-#include "settings.h"
-#include "str.h"
-#include "variable.h"
+
+#include <data/dictionary.h>
+#include <procedure.h>
+#include <data/settings.h>
+#include <language/command.h>
+#include <language/lexer/lexer.h>
+#include <language/line-buffer.h>
+#include <libpspp/alloc.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
+#include <libpspp/misc.h>
+#include <libpspp/pool.h>
+#include <libpspp/str.h>
+#include <data/variable.h>
+
+#include "intprops.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-#include "debug-print.h"
-
 /* Defines a list of lines used by DO REPEAT. */
 struct line_list
   {
@@ -363,7 +367,7 @@ parse_ids (struct repeat_entry *e)
 static inline void
 store_numeric (char **repl, long value)
 {
-  *repl = xmalloc (INT_DIGITS + 1);
+  *repl = xmalloc (INT_STRLEN_BOUND (value) + 1);
   sprintf (*repl, "%ld", value);
 }
 
@@ -561,7 +565,7 @@ do_repeat_read (struct string *output, char **file_name, int *line_number,
     }
   line = block->cur_line;
 
-  ds_replace (output, line->line);
+  ds_assign_c_str (output, line->line);
   *file_name = line->file_name;
   *line_number = -line->line_number;
   block->cur_line = line->next;