Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.5
 
1.6
 
MAIN:ragge:20040822140937
 
cpp.c
_>780780         usch *vp;
 781781         struct recur *rp;
 782782 {
<>783 -        usch **args, *obuf, *ap, *bp, *sp;
  783+        usch **args, *sptr, *ap, *bp, *sp;
784784         int narg, c, i, plev, snuff, instr;
 785785 
 786786 if (dflag)printf("expdef %s rp %s\n", vp, (rp ? (char *)rp->sp->namep : ""));
     
 !
794794          * read arguments and store them on heap.
 795795          * will be removed just before return from this function.
 796796          */
<>797 -        obuf = stringbuf;
  797+        sptr = stringbuf;
798798         for (i = 0; i < narg && c != ')'; i++) {
 799799                 args[i] = stringbuf;
 800800                 plev = 0;
     
 !
860860                         while (*bp)
 861861                                 bp++;
 862862                         while (bp > ap) {
<>863 -                                cunput(*--bp);
 864 -                                if (*bp == '"' && bp[-1] != '\\' && snuff) {
  863+                                bp--;
  864+//printf("*bp %d\n", *bp);
  865+                                if (snuff && !instr &&
  866+                                    (*bp == ' ' || *bp == '\t' || *bp == '\n')){
  867+                                        while (*bp == ' ' || *bp == '\t' ||
  868+                                            *bp == '\n') {
  869+                                                if (*bp == '\n')
  870+                                                        putc('\n', obuf);
  871+                                                bp--;
  872+                                        }
  873+                                        cunput(' ');
  874+                                }
  875+                                cunput(*bp);
  876+                                if ((*bp == '\'' || *bp == '"')
  877+                                     && bp[-1] != '\\' && snuff) {
865878                                         instr ^= 1;
<>866 -                                        if (instr == 0)
  879+                                        if (instr == 0 && *bp == '"')
867880                                                 cunput('\\');
 868881                                 }
 869882                                 if (instr && (*bp == '\\' || *bp == '"'))
     
 !
873886                         cunput(*sp);
 874887                 sp--;
 875888         }
<>876 -        stringbuf = obuf;
  889+        stringbuf = sptr;
<_877890 
 878891         /* scan the input buffer (until WARN) and save result on heap */
 879892         expmac(rp);
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-20 06:54 +0200