Changeset 3877fe in git


Ignore:
Timestamp:
Aug 1, 2012, 11:37:25 PM (10 years ago)
Author:
Alexander Dreyer <alexander.dreyer@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '96ce329119711a2b80858c8365abd29f8460bbfa')
Children:
c6909feb8b8906ced71bef772f72f8bd461d7f4c
Parents:
9165865409bb43ba082670375c4a04e78f8b76e1
Message:
fix: newstruct's string operator may be overloaded
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    r916586 r3877fe  
    5050  {
    5151    newstruct_desc ad=(newstruct_desc)(b->data);
     52
     53    newstruct_proc p=ad->procs;
     54    while((p!=NULL)&&(p->t!=STRING_CMD))
     55      p=p->next;
     56
     57    if (p!=NULL)
     58    {
     59      leftv sl;
     60      sleftv tmp;
     61      memset(&tmp,0,sizeof(tmp));
     62      tmp.rtyp=ad->id;
     63      void * newstruct_Copy(blackbox*, void *); //forward declaration
     64      tmp.data=(void*)newstruct_Copy(b,d);
     65      idrec hh;
     66      memset(&hh,0,sizeof(hh));
     67      hh.id=Tok2Cmdname(p->t);
     68      hh.typ=PROC_CMD;
     69      hh.data.pinf=p->p;
     70      sl=iiMake_proc(&hh,NULL,&tmp);
     71
     72      if (sl->Typ() == STRING_CMD)
     73      {
     74        char *res = omStrDup((char*)sl->Data());
     75        sl->CleanUp();
     76        return res;
     77      }
     78      else
     79        sl->CleanUp();     
     80    }
     81
    5282    lists l=(lists)d;
    5383    newstruct_member a=ad->member;
Note: See TracChangeset for help on using the changeset viewer.