Fossil SCM

Only strip trailing newline when importing comments.

roy.marples 2017-02-21 21:36 UTC roy-export
Commit 0e4bf2ca5ff0451d7ce47136aefc226c750d39d4
1 file changed +4 -5
+4 -5
--- src/import.c
+++ src/import.c
@@ -606,17 +606,16 @@
606606
gg.aData = fossil_malloc( gg.nData+1 );
607607
got = fread(gg.aData, 1, gg.nData, pIn);
608608
if( got!=gg.nData ){
609609
fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
610610
}
611
- /* Strip trailing newline, it's appended to the comment. */
612
- if( gg.aData[got-1] == '\n' )
613
- gg.aData[got-1] = '\0';
614
- else
615
- gg.aData[got] = '\0';
611
+ gg.aData[got] = '\0';
616612
if( gg.zComment==0 &&
617613
(gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
614
+ /* Strip trailing newline, it's appended to the comment. */
615
+ if( gg.aData[got-1] == '\n' )
616
+ gg.aData[got-1] = '\0';
618617
gg.zComment = gg.aData;
619618
gg.aData = 0;
620619
gg.nData = 0;
621620
}
622621
}
623622
--- src/import.c
+++ src/import.c
@@ -606,17 +606,16 @@
606 gg.aData = fossil_malloc( gg.nData+1 );
607 got = fread(gg.aData, 1, gg.nData, pIn);
608 if( got!=gg.nData ){
609 fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
610 }
611 /* Strip trailing newline, it's appended to the comment. */
612 if( gg.aData[got-1] == '\n' )
613 gg.aData[got-1] = '\0';
614 else
615 gg.aData[got] = '\0';
616 if( gg.zComment==0 &&
617 (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
 
 
 
618 gg.zComment = gg.aData;
619 gg.aData = 0;
620 gg.nData = 0;
621 }
622 }
623
--- src/import.c
+++ src/import.c
@@ -606,17 +606,16 @@
606 gg.aData = fossil_malloc( gg.nData+1 );
607 got = fread(gg.aData, 1, gg.nData, pIn);
608 if( got!=gg.nData ){
609 fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
610 }
611 gg.aData[got] = '\0';
 
 
 
 
612 if( gg.zComment==0 &&
613 (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
614 /* Strip trailing newline, it's appended to the comment. */
615 if( gg.aData[got-1] == '\n' )
616 gg.aData[got-1] = '\0';
617 gg.zComment = gg.aData;
618 gg.aData = 0;
619 gg.nData = 0;
620 }
621 }
622

Keyboard Shortcuts

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