Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the display of unified-diff lines on web pages when the files being compared have windows-style line endings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e2e8531ba76915e3db1c96b4637184ee3b5a15cb
User & Date: drh 2014-03-14 20:49:19
Context
2014-03-15
14:35
Fix the "artifact" URL to render markdown text automatically. check-in: 60019ce7 user: drh tags: trunk
2014-03-14
20:49
Fix the display of unified-diff lines on web pages when the files being compared have windows-style line endings. check-in: e2e8531b user: drh tags: trunk
16:20
When compiled on Cygwin using --disable-internal-sqlite, this special Cygwin handling is no longer necessary (SQLite 3.8.4.1 Cygwin build already handles that). check-in: 625297ab user: jan.nijtmans tags: trunk
Changes

Changes to src/diff.c.

225
226
227
228
229
230
231

232
233
234
235
236
237
238


239
240
241
242
243
244
245
246
  char cPrefix,       /* One of " ", "+",  or "-" */
  DLine *pLine,       /* The line to be output */
  int html,           /* True if generating HTML.  False for plain text */
  ReCompiled *pRe     /* Colorize only if line matches this Regex */
){
  blob_append(pOut, &cPrefix, 1);
  if( html ){

    if( pRe && re_dline_match(pRe, pLine, 1)==0 ){
      cPrefix = ' ';
    }else if( cPrefix=='+' ){
      blob_append(pOut, "<span class=\"diffadd\">", -1);
    }else if( cPrefix=='-' ){
      blob_append(pOut, "<span class=\"diffrm\">", -1);
    }


    htmlize_to_blob(pOut, pLine->z, pLine->n);
    if( cPrefix!=' ' ){
      blob_append(pOut, "</span>", -1);
    }
  }else{
    blob_append(pOut, pLine->z, pLine->n);
  }
  blob_append(pOut, "\n", 1);







>







>
>
|







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
  char cPrefix,       /* One of " ", "+",  or "-" */
  DLine *pLine,       /* The line to be output */
  int html,           /* True if generating HTML.  False for plain text */
  ReCompiled *pRe     /* Colorize only if line matches this Regex */
){
  blob_append(pOut, &cPrefix, 1);
  if( html ){
    int n;
    if( pRe && re_dline_match(pRe, pLine, 1)==0 ){
      cPrefix = ' ';
    }else if( cPrefix=='+' ){
      blob_append(pOut, "<span class=\"diffadd\">", -1);
    }else if( cPrefix=='-' ){
      blob_append(pOut, "<span class=\"diffrm\">", -1);
    }
    n = pLine->n;
    while( n>0 && (pLine->z[n-1]=='\n' || pLine->z[n-1]=='\r') ) n--;
    htmlize_to_blob(pOut, pLine->z, n);
    if( cPrefix!=' ' ){
      blob_append(pOut, "</span>", -1);
    }
  }else{
    blob_append(pOut, pLine->z, pLine->n);
  }
  blob_append(pOut, "\n", 1);