Fossil SCM

Bug-fix: correct calculation of hash-value for lines with different eol-spacing. Taken from [8f885df209], but without the other enhancements. Eliminate some double semicolons.

jan.nijtmans 2014-03-03 15:00 trunk
Commit 7a0f4af68efd069630cf66a17eba4b5ea4c23e08
2 files changed +2 -2 +2 -2
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -1560,11 +1560,11 @@
15601560
** should be committed.
15611561
*/
15621562
if( select_commit_files() ){
15631563
prompt_user("continue (y/N)? ", &ans);
15641564
cReply = blob_str(&ans)[0];
1565
- if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1565
+ if( cReply!='y' && cReply!='Y' ) fossil_exit(1);
15661566
}
15671567
isAMerge = db_exists("SELECT 1 FROM vmerge WHERE id=0 OR id<-2");
15681568
if( g.aCommitFile && isAMerge ){
15691569
fossil_fatal("cannot do a partial commit of a merge");
15701570
}
@@ -1660,11 +1660,11 @@
16601660
char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
16611661
prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
16621662
if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
16631663
prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
16641664
cReply = blob_str(&ans)[0];
1665
- if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1665
+ if( cReply!='y' && cReply!='Y' ) fossil_exit(1);
16661666
}
16671667
free(zInit);
16681668
}
16691669
if( blob_size(&comment)==0 ){
16701670
if( !dryRunFlag ){
16711671
--- src/checkin.c
+++ src/checkin.c
@@ -1560,11 +1560,11 @@
1560 ** should be committed.
1561 */
1562 if( select_commit_files() ){
1563 prompt_user("continue (y/N)? ", &ans);
1564 cReply = blob_str(&ans)[0];
1565 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1566 }
1567 isAMerge = db_exists("SELECT 1 FROM vmerge WHERE id=0 OR id<-2");
1568 if( g.aCommitFile && isAMerge ){
1569 fossil_fatal("cannot do a partial commit of a merge");
1570 }
@@ -1660,11 +1660,11 @@
1660 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1661 prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
1662 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1663 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
1664 cReply = blob_str(&ans)[0];
1665 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);;
1666 }
1667 free(zInit);
1668 }
1669 if( blob_size(&comment)==0 ){
1670 if( !dryRunFlag ){
1671
--- src/checkin.c
+++ src/checkin.c
@@ -1560,11 +1560,11 @@
1560 ** should be committed.
1561 */
1562 if( select_commit_files() ){
1563 prompt_user("continue (y/N)? ", &ans);
1564 cReply = blob_str(&ans)[0];
1565 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);
1566 }
1567 isAMerge = db_exists("SELECT 1 FROM vmerge WHERE id=0 OR id<-2");
1568 if( g.aCommitFile && isAMerge ){
1569 fossil_fatal("cannot do a partial commit of a merge");
1570 }
@@ -1660,11 +1660,11 @@
1660 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1661 prepare_commit_comment(&comment, zInit, &sCiInfo, vid);
1662 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
1663 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
1664 cReply = blob_str(&ans)[0];
1665 if( cReply!='y' && cReply!='Y' ) fossil_exit(1);
1666 }
1667 free(zInit);
1668 }
1669 if( blob_size(&comment)==0 ){
1670 if( !dryRunFlag ){
1671
+2 -2
--- src/diff.c
+++ src/diff.c
@@ -162,14 +162,14 @@
162162
for(i=0; i<nLine; i++){
163163
a[i].z = z;
164164
for(j=0; z[j] && z[j]!='\n'; j++){}
165165
k = j;
166166
while( ignoreWS && k>0 && fossil_isspace(z[k-1]) ){ k--; }
167
- for(h=0, x=0; x<=k; x++){
167
+ for(h=0, x=0; x<k; x++){
168168
h = h ^ (h<<2) ^ z[x];
169169
}
170
- a[i].h = h = (h<<LENGTH_MASK_SZ) | k;;
170
+ a[i].h = h = (h<<LENGTH_MASK_SZ) | k;
171171
h2 = h % nLine;
172172
a[i].iNext = a[h2].iHash;
173173
a[h2].iHash = i+1;
174174
z += j+1;
175175
}
176176
--- src/diff.c
+++ src/diff.c
@@ -162,14 +162,14 @@
162 for(i=0; i<nLine; i++){
163 a[i].z = z;
164 for(j=0; z[j] && z[j]!='\n'; j++){}
165 k = j;
166 while( ignoreWS && k>0 && fossil_isspace(z[k-1]) ){ k--; }
167 for(h=0, x=0; x<=k; x++){
168 h = h ^ (h<<2) ^ z[x];
169 }
170 a[i].h = h = (h<<LENGTH_MASK_SZ) | k;;
171 h2 = h % nLine;
172 a[i].iNext = a[h2].iHash;
173 a[h2].iHash = i+1;
174 z += j+1;
175 }
176
--- src/diff.c
+++ src/diff.c
@@ -162,14 +162,14 @@
162 for(i=0; i<nLine; i++){
163 a[i].z = z;
164 for(j=0; z[j] && z[j]!='\n'; j++){}
165 k = j;
166 while( ignoreWS && k>0 && fossil_isspace(z[k-1]) ){ k--; }
167 for(h=0, x=0; x<k; x++){
168 h = h ^ (h<<2) ^ z[x];
169 }
170 a[i].h = h = (h<<LENGTH_MASK_SZ) | k;
171 h2 = h % nLine;
172 a[i].iNext = a[h2].iHash;
173 a[h2].iHash = i+1;
174 z += j+1;
175 }
176

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button