Fossil

Check-in [1438be02]
Login

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

Overview
Comment:Distinguish between a deleted file and a binary file in the side-by-side diff generator. Fix for a bug introduced by check-in [233e9328ee639b].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1438be02d02f27e78690560bca2d5985ad49bba6
User & Date: drh 2016-09-29 11:59:05
Context
2016-09-30
13:21
Fix a doc typo. Minor improvements to documentation linkage. check-in: c468769d user: drh tags: trunk
03:49
Add the "fossil diff --changes" option to show the changes made by a specific checkin UUID. check-in: 4556962d user: andybradford tags: diff-show-changes
2016-09-29
11:59
Distinguish between a deleted file and a binary file in the side-by-side diff generator. Fix for a bug introduced by check-in [233e9328ee639b]. check-in: 1438be02 user: drh tags: trunk
2016-09-28
23:47
In the random merge test (merge2.test) ignore cases where the parallel random edits overlap, resulting in a merge conflict. check-in: caea288c user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/diff.c.

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157




158
159
160
161
162
163
164
  u64 diffFlags
){
  int nLine, i, k, nn, s, x;
  unsigned int h, h2;
  DLine *a;
  const char *zNL, *z2;

  /* Early-out for the degenerate case */
  if( n==0 ) return 0;

  /* Count the number of lines in the input file.  Include the last line
  ** in the count even if it lacks the \n terminator
  */
  for(nLine=0, z2=z; (zNL = strchr(z2,'\n'))!=0; z2=zNL+1, nLine++){}
  if( z2[0]!=0 ) nLine++;

  a = fossil_malloc( sizeof(a[0])*nLine );
  memset(a, 0, sizeof(a[0])*nLine);




  i = 0;
  do{
    zNL = strchr(z,'\n');
    if( zNL==0 ) zNL = z+strlen(z);
    nn = (int)(zNL - z);
    if( nn>LENGTH_MASK ){
      fossil_free(a);







<
<
<








>
>
>
>







140
141
142
143
144
145
146



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  u64 diffFlags
){
  int nLine, i, k, nn, s, x;
  unsigned int h, h2;
  DLine *a;
  const char *zNL, *z2;




  /* Count the number of lines in the input file.  Include the last line
  ** in the count even if it lacks the \n terminator
  */
  for(nLine=0, z2=z; (zNL = strchr(z2,'\n'))!=0; z2=zNL+1, nLine++){}
  if( z2[0]!=0 ) nLine++;

  a = fossil_malloc( sizeof(a[0])*nLine );
  memset(a, 0, sizeof(a[0])*nLine);
  if( nLine==0 ){
    *pnLine = 0;
    return a;
  }
  i = 0;
  do{
    zNL = strchr(z,'\n');
    if( zNL==0 ) zNL = z+strlen(z);
    nn = (int)(zNL - z);
    if( nn>LENGTH_MASK ){
      fossil_free(a);