From c54e43d24f0e9effa678c2eddfcfcd7df1671899 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 4 Aug 2023 15:02:55 +0200 Subject: [PATCH] allow expandion of labels like aaa[3:2]_qq --> aaa[3]_qq,aaa[2]_qq and aaa[3..2]_qq --> aaa3_qq,aaa2_qq --- src/expandlabel.y | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/src/expandlabel.y b/src/expandlabel.y index a372596b..1c29d1be 100644 --- a/src/expandlabel.y +++ b/src/expandlabel.y @@ -174,6 +174,28 @@ static char *expandlabel_strmult(int n, char *s) return str; } + +static char *expandlabel_strbus_suffix(char *s, int *n, char *suffix) +{ + int i,l; + int tmplen; + char *res=NULL; + char *tmp=NULL; + my_realloc(_ALLOC_ID_, &res, n[0] * (strlen(s) + strlen(suffix) + 30)); + my_realloc(_ALLOC_ID_, &tmp, strlen(s) + strlen(suffix) + 30); + l=0; + for(i=1;i