Skip to content

Commit

Permalink
fix missing > before empty quote lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Mar 23, 2023
1 parent 35dc351 commit 9a78edd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ additional documentation and more details are available in `man gplaces`. type `
## Statistic
Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
C|1|250|58|1140
C|1|252|58|1141
11 changes: 7 additions & 4 deletions gplaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,17 +458,18 @@ static void print_gemtext_line(FILE *fp, Selector *sel, const regex_t *filter, i
size_t size, mbs;
wchar_t wchar;
const char *p;
int w, wchars, out, extra, i;
int w, wchars, out, extra, i = 0;

if (sel->type == 'l') ++*links;

if (filter && regexec(filter, sel->repr, 0, NULL, 0) != 0 && (sel->rawurl == NULL || regexec(filter, sel->rawurl, 0, NULL, 0) != 0)) return;
if (!interactive) { fprintf(fp, "%s\n", sel->repr); return; }

size = strlen(sel->repr);
if (size == 0) { fputc('\n', fp); return; }

for (i = 0, out = (int)size; i < (int)size; i += out, i += strspn(&sel->repr[i], " "), out = (int)size) {
do {
out = (int)size;

extra = 0;
switch (sel->type) {
case 'l': if (i == 0) extra = 3 + ndigits(*links); break;
Expand Down Expand Up @@ -519,7 +520,9 @@ static void print_gemtext_line(FILE *fp, Selector *sel, const regex_t *filter, i
if (i == 0) fprintf(fp, "%c %.*s\n", sel->type, out, &sel->repr[i]);
else fprintf(fp, " %.*s\n", out, &sel->repr[i]);
}
}

i += out + strspn(&sel->repr[i + out], " ");
} while (i < (int)size);
}


Expand Down

0 comments on commit 9a78edd

Please sign in to comment.