Fossil

Diff
Login

Differences From Artifact [d1c60722e0]:

To Artifact [58d1a8991b]:


377
378
379
380
381
382
383
384

385
386
387
388
389
390
391
377
378
379
380
381
382
383

384
385
386
387
388
389
390
391







-
+







#define SBS_PAD          0x0002   /* Pad output to width spaces */

/*
** Write up to width characters of pLine into p->zLine[].  Translate tabs into
** spaces.  Add a newline if SBS_NEWLINE is set.  Translate HTML characters
** if SBS_HTML is set.  Pad the rendering out width bytes if SBS_PAD is set.
**
** This comment contains multi-byte unicode characters (ü, Æ, ð) in order
** This comment contains multibyte unicode characters (ü, Æ, ð) in order
** to test the ability of the diff code to handle such characters.
*/
static void sbsWriteText(SbsLine *p, DLine *pLine, unsigned flags){
  int n = pLine->h & LENGTH_MASK;
  int i;   /* Number of input characters consumed */
  int j;   /* Number of output characters generated */
  int k;   /* Cursor position */
428
429
430
431
432
433
434

435
436
437
438
439
440
441
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442







+







      memcpy(&z[j], "&", 5);
      j += 5;
    }else if( c=='>' && p->escHtml ){
      memcpy(&z[j], ">", 4);
      j += 4;
    }else{
      z[j++] = c;
      if( (c&0xc0)==0x80 ) k--;
    }
  }
  if( needEndSpan ){
    memcpy(&z[j], "</span>", 7);
    j += 7;
  }
  if( (flags & SBS_PAD)!=0 ){
883
884
885
886
887
888
889
890

891
892
893
894
895
896
897
884
885
886
887
888
889
890

891
892
893
894
895
896
897
898







-
+







  int i, j;     /* Loop counters */
  int m, ma, mb;/* Number of lines to output */
  int skip;     /* Number of lines to skip */
  int nChunk = 0; /* Number of chunks of diff output seen so far */
  SbsLine s;    /* Output line buffer */

  memset(&s, 0, sizeof(s));
  s.zLine = fossil_malloc( 10*width + 200 );
  s.zLine = fossil_malloc( 15*width + 200 );
  if( s.zLine==0 ) return;
  s.width = width;
  s.escHtml = escHtml;
  s.iStart = -1;
  s.iStart2 = 0;
  s.iEnd = -1;
  A = p->aFrom;