smu

Simple markup processor
git clone https://git.sinitax.com/codemadness/smu
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 4696810e4b8813fed008242933c9024c3e0f7214
parent 21827365371b61154e77ce86cfaadea57bcd7573
Author: gottox@rootkit.lan <gottox@rootkit.lan>
Date:   Fri, 14 Dec 2007 12:41:23 +0100

-Wall does not produce warnings anymore.

Diffstat:
Mcmarkdown.c | 13++++++++-----
Mconfig.mk | 2+-
2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/cmarkdown.c b/cmarkdown.c @@ -216,7 +216,7 @@ dolineprefix(const char *begin, const char *end, int first) { unsigned int dolink(const char *begin, const char *end, int first) { int img; - const char *desc, *link, *p, *q, *r, *descend, *linkend; + const char *desc, *link, *p, *q, *descend, *linkend; if(*begin == '[') img = 0; @@ -254,16 +254,17 @@ dolink(const char *begin, const char *end, int first) { unsigned int dolist(const char *begin, const char *end, int first) { - unsigned int i,j,indent,run,ul, isblock; + unsigned int i, j, indent, run, ul, isblock; const char *p, *q; char *buffer; - if(*begin != '\n' || begin[1] != '\n' && !first) + if((*begin != '\n' || begin[1] != '\n') && !first) return 0; p = begin; if(!first) p += 2; q = p; + isblock = 0; if((*p == '-' || *p == '*' || *p == '+') && (p[1] == ' ' || p[1] == '\t')) { ul = 1; } @@ -290,6 +291,7 @@ dolist(const char *begin, const char *end, int first) { ADDC(buffer,i) = '\n'; i++; run = 0; + isblock = 1; } q = p + 1; j = 0; @@ -317,7 +319,7 @@ dolist(const char *begin, const char *end, int first) { ADDC(buffer,i) = *p; } fputs("<li>",stdout); - process(buffer,buffer+i,0); //TODO + process(buffer,buffer+i,isblock); //TODO fputs("</li>\n",stdout); } fputs(ul ? "</ul>\n" : "</ol>\n",stdout); @@ -524,7 +526,7 @@ main(int argc, char *argv[]) { p = buffer+strlen(buffer); - while(s = fread(p, sizeof(char),BUFFERSIZE, source)) { + while((s = fread(p, sizeof(char),BUFFERSIZE, source))) { p += s; *p = '\0'; if(BUFFERSIZE + strlen(buffer) > bsize) { @@ -536,5 +538,6 @@ main(int argc, char *argv[]) { process(buffer,buffer+strlen(buffer),1); putchar('\n'); free(buffer); + return 0; } diff --git a/config.mk b/config.mk @@ -10,7 +10,7 @@ INCS = -I. -I/usr/include LIBS = -L/usr/lib # flags -CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" +CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -Wall LDFLAGS = ${LIBS} # compiler