~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to interpret.h

  • Committer: Arnold D. Robbins
  • Date: 2024-12-15 12:52:08 UTC
  • mfrom: (2057.3.16)
  • Revision ID: git-v1:3886d976985bfd963491853cdb3a6764694e7711
Merge branch 'gawk-5.3-stable'

Show diffs side-by-side

added added

removed removed

Lines of Context:
843
843
                        if (t1 != t2 && t1->valref == 1 && (t1->flags & (MALLOC|MPFN|MPZN)) == MALLOC) {
844
844
                                size_t nlen = t1->stlen + t2->stlen;
845
845
 
846
 
                                erealloc(t1->stptr, char *, nlen + 1, "r_interpret");
 
846
                                erealloc(t1->stptr, char *, nlen + 1);
847
847
                                memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
848
848
                                t1->stlen = nlen;
849
849
                                t1->stptr[nlen] = '\0';
859
859
                                if ((t1->flags & WSTRCUR) != 0 && (t2->flags & WSTRCUR) != 0) {
860
860
                                        size_t wlen = t1->wstlen + t2->wstlen;
861
861
 
862
 
                                        erealloc(t1->wstptr, wchar_t *,
863
 
                                                        sizeof(wchar_t) * (wlen + 1), "r_interpret");
 
862
                                        erealloc(t1->wstptr, wchar_t *, sizeof(wchar_t) * (wlen + 1));
864
863
                                        memcpy(t1->wstptr + t1->wstlen, t2->wstptr, t2->wstlen * sizeof(wchar_t));
865
864
                                        t1->wstlen = wlen;
866
865
                                        t1->wstptr[wlen] = L'\0';
870
869
                                size_t nlen = t1->stlen + t2->stlen;
871
870
                                char *p;
872
871
 
873
 
                                emalloc(p, char *, nlen + 1, "r_interpret");
 
872
                                emalloc(p, char *, nlen + 1);
874
873
                                memcpy(p, t1->stptr, t1->stlen);
875
874
                                memcpy(p + t1->stlen, t2->stptr, t2->stlen);
876
875
                                /* N.B. No NUL-termination required, since make_str_node will do it. */