summaryrefslogtreecommitdiff
path: root/do/repeatary
diff options
context:
space:
mode:
Diffstat (limited to 'do/repeatary')
-rw-r--r--do/repeatary25
1 files changed, 25 insertions, 0 deletions
diff --git a/do/repeatary b/do/repeatary
new file mode 100644
index 0000000000..856a83d31f
--- /dev/null
+++ b/do/repeatary
@@ -0,0 +1,25 @@
+int
+do_repeatary(ARGS)
+ARGSdecl
+{
+ MSP;
+ register int count = POPi;
+ register int items = sp - mark;
+ register int i;
+ int max;
+
+ max = items * count;
+ MEXTEND(mark,max);
+ if (count > 1) {
+ while (sp > mark) {
+ if (*sp)
+ (*sp)->str_pok &= ~SP_TEMP;
+ }
+ mark++;
+ repeatcpy(mark + items, mark, items * sizeof(STR*), count - 1);
+ }
+ sp += max;
+
+ MRETURN;
+}
+