Further small fixes

This commit is contained in:
gottox@rootkit.lan 2007-12-13 13:42:03 +01:00
parent 4fce2bfe47
commit fea415180a

View file

@ -260,7 +260,7 @@ dolist(const char *begin, const char *end) {
if(!(buffer = malloc(BUFFERSIZE))) if(!(buffer = malloc(BUFFERSIZE)))
eprint("Malloc failed."); eprint("Malloc failed.");
puts(ul ? "<ul>" : "<ol>"); puts(ul ? "\n<ul>" : "\n<ol>");
run = 1; run = 1;
for(i = 0; *p && p < end && run; p++) { for(i = 0; *p && p < end && run; p++) {
buffer[0] = '\0'; buffer[0] = '\0';
@ -271,20 +271,22 @@ dolist(const char *begin, const char *end) {
run = 0; run = 0;
} }
q = p + 1; q = p + 1;
j = 0;
if(ul && (*q == '-' || *q == '*' || *q == '+')) if(ul && (*q == '-' || *q == '*' || *q == '+'))
j = 1; j = 1;
else { else if(!ul) {
for(j = 0; q[j] >= '0' && q[j] <= '9' && j < indent; j++); for(; q[j] >= '0' && q[j] <= '9' && j < indent; j++);
if(j > 0 && q[j] == '.') if(j > 0 && q[j] == '.')
j++; j++;
else else
j = 0; j = 0;
} }
for(;q[j] == ' ' && j < indent; j++); for(;q[j] == ' ' && j < indent; j++);
//printf("--%i %i--\n",j,indent);
if(j == indent) { if(j == indent) {
p += indent; p += indent;
run = 1; run = 1;
if(q[1] == ' ') if(q[0] == ' ')
p++; p++;
else else
break; break;
@ -326,7 +328,7 @@ doparagraph(const char *begin, const char *end) {
fputs("\n<p>",stdout); fputs("\n<p>",stdout);
process(begin+2,p); process(begin+2,p);
fputs("</p>\n",stdout); fputs("</p>\n",stdout);
return p - begin; return p - begin + 1;
} }
unsigned int unsigned int