Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Change the built-in "diff" so that it no longer ignores whitespace at the end of lines, as doing so confuses the "patch" command. Ticket [a9f7b23c2e376af5b0] |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
7f788bdb045c8e149fec1ab7f36b9a3f |
| User & Date: | drh 2010-08-21 03:33:06.000 |
Context
|
2010-08-21
| ||
| 04:06 | The command-line "diff" does not ignore whitespace at the end of lines and it generates a well-formed patch file that can be fed directly into "patch -p 0". Ticket [a9f7b23c2e376af]. GUI diffs and the merge commands do ignore end-of-line whitespace. ... (check-in: 5ef7435ac0 user: drh tags: trunk) | |
| 03:33 | Change the built-in "diff" so that it no longer ignores whitespace at the end of lines, as doing so confuses the "patch" command. Ticket [a9f7b23c2e376af5b0] ... (check-in: 7f788bdb04 user: drh tags: trunk) | |
| 03:27 | Fix a potential segfault in the graph generator when check-ins occur with time skew. ... (check-in: 32c9c47c93 user: drh tags: trunk) | |
Changes
Changes to src/diff.c.
| ︙ | ︙ | |||
63 64 65 66 67 68 69 | }; /* ** Return an array of DLine objects containing a pointer to the ** start of each line and a hash of that line. The lower ** bits of the hash store the length of each line. ** | | > > | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
};
/*
** Return an array of DLine objects containing a pointer to the
** start of each line and a hash of that line. The lower
** bits of the hash store the length of each line.
**
** Trailing whitespace is removed from each line. 2010-08-20: Not any
** more. If trailing whitespace is ignored, the "patch" command gets
** confused by the diff output. Ticket [a9f7b23c2e376af5b0e5b]
**
** Return 0 if the file is binary or contains a line that is
** too long.
*/
static DLine *break_into_lines(const char *z, int n, int *pnLine){
int nLine, i, j, k, x;
unsigned int h, h2;
|
| ︙ | ︙ | |||
100 101 102 103 104 105 106 |
if( a==0 ) fossil_panic("out of memory");
memset(a, 0, nLine*sizeof(a[0]) );
/* Fill in the array */
for(i=0; i<nLine; i++){
a[i].z = z;
for(j=0; z[j] && z[j]!='\n'; j++){}
| | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
if( a==0 ) fossil_panic("out of memory");
memset(a, 0, nLine*sizeof(a[0]) );
/* Fill in the array */
for(i=0; i<nLine; i++){
a[i].z = z;
for(j=0; z[j] && z[j]!='\n'; j++){}
for(k=j; k>0 && isspace(z[k-1]); k--){break;}
for(h=0, x=0; x<k; x++){
h = h ^ (h<<2) ^ z[x];
}
a[i].h = h = (h<<LENGTH_MASK_SZ) | k;;
h2 = h % nLine;
a[i].iNext = a[h2].iHash;
a[h2].iHash = i+1;
|
| ︙ | ︙ |