Fossil

Check-in [0e4bf2ca]
Login

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

Overview
Comment:Only strip trailing newline when importing comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | roy-export
Files: files | file ages | folders
SHA1:0e4bf2ca5ff0451d7ce47136aefc226c750d39d4
User & Date: roy.marples 2017-02-21 21:36:29
Context
2017-02-21
22:18
Cast strlen to int to avoid a compiler error and to be consitent elsewhere. check-in: 7a93cd88 user: roy.marples tags: roy-export
21:36
Only strip trailing newline when importing comments. check-in: 0e4bf2ca user: roy.marples tags: roy-export
2017-02-13
10:59
Cards must appear in a lexical order. Thanks Jan! check-in: 84804f01 user: roy.marples tags: roy-export
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

604
605
606
607
608
609
610
611
612
613
614
615
616
617



618
619
620
621
622
623
624
      if( gg.nData ){
        int got;
        gg.aData = fossil_malloc( gg.nData+1 );
        got = fread(gg.aData, 1, gg.nData, pIn);
        if( got!=gg.nData ){
          fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
        }
	/* Strip trailing newline, it's appended to the comment. */
	if( gg.aData[got-1] == '\n' )
	  gg.aData[got-1] = '\0';
        else
          gg.aData[got] = '\0';
        if( gg.zComment==0 &&
            (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){



          gg.zComment = gg.aData;
          gg.aData = 0;
          gg.nData = 0;
        }
      }
    }else
    if( strncmp(zLine, "author ", 7)==0 ){







<
<
<
<
|


>
>
>







604
605
606
607
608
609
610




611
612
613
614
615
616
617
618
619
620
621
622
623
      if( gg.nData ){
        int got;
        gg.aData = fossil_malloc( gg.nData+1 );
        got = fread(gg.aData, 1, gg.nData, pIn);
        if( got!=gg.nData ){
          fossil_fatal("short read: got %d of %d bytes", got, gg.nData);
        }




        gg.aData[got] = '\0';
        if( gg.zComment==0 &&
            (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){
	  /* Strip trailing newline, it's appended to the comment. */
	  if( gg.aData[got-1] == '\n' )
	    gg.aData[got-1] = '\0';
          gg.zComment = gg.aData;
          gg.aData = 0;
          gg.nData = 0;
        }
      }
    }else
    if( strncmp(zLine, "author ", 7)==0 ){