fixed corrupted multi line comments, when a blank line (containing only white spaces) is present in the comment

Wed, 10 Feb 2016 12:34:31 +0100

author
universe
date
Wed, 10 Feb 2016 12:34:31 +0100
changeset 31
50ae611a785c
parent 30
0bfd4d6f086a
child 32
10389d866a4d

fixed corrupted multi line comments, when a blank line (containing only white spaces) is present in the comment

src/ccodegen.c file | annotate | diff | comparison | revisions
test/ctestfile.c file | annotate | diff | comparison | revisions
--- a/src/ccodegen.c	Fri May 29 14:32:02 2015 +0200
+++ b/src/ccodegen.c	Wed Feb 10 12:34:31 2016 +0100
@@ -51,18 +51,14 @@
                                     dp += sizeof(str)-1
 
 void cparseline(char *src, char *dest, highlighter_t *hltr) {
-    size_t sp = 0, dp = 0;
-    /* indent */
-    while (isspace(src[sp])) {
-        dest[dp++] = src[sp++];
-    }
 
     memset(hltr->word, 0, WORDBUF_SIZE);
-    size_t wp = 0, ifp = 0;
+    size_t wp = 0, ifp = 0, sp = 0, dp = 0;
     int isstring = 0, iscomment = 0, isinclude = 0, parseinclude = 0;
     char quote = '\0';
     int isescaping = 0;
-
+    
+    /* continue a multi line comment highlighting */
     if (hltr->iscommentml) {
         iscomment = 1;
         memcpy_const(dest, dp, "<span class=\"c2html-comment\">");
--- a/test/ctestfile.c	Fri May 29 14:32:02 2015 +0200
+++ b/test/ctestfile.c	Wed Feb 10 12:34:31 2016 +0100
@@ -48,6 +48,8 @@
 #include "webdav.h"
 
 
+/* -------------------- This is a testing file. -------------------------- */
+/*
 time_t util_parse_creationdate(char *str) {
     // example: 2012-11-29T21:35:35Z
     if(!str) {
@@ -56,7 +58,7 @@
     // TODO
     return 0;
 }
-
+*/
 time_t util_parse_lastmodified(char *str) {
     // example: Thu, 29 Nov 2012 21:35:35 GMT
     if(!str) {
@@ -308,6 +310,8 @@
     return ret_str;
 }
 
+/* commented out for testing reasons */
+/*
 char* util_decrypt_str(DavSession *sn, char *str, char *key) {
     DavKey *k = dav_context_get_key(sn->context, key);
     if(!k) {
@@ -320,7 +324,7 @@
     free(dec_str);
     return ret_str;
 }
-
+*/
 char* util_random_str() {
     unsigned char *str = malloc(25);
     str[24] = '\0';

mercurial