cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit cc3f9a5eea25ad350039d7e552bec944b3a121b0
parent 3ce02e5183da68e017b572265d68f19fef59043c
Author: René Wagner <rwagner@rw-net.de>
Date:   Mon,  4 Jan 2021 19:07:12 +0100

use different colors for gemini and other links

Diffstat:
Mcgmnlm | 0
Msrc/cgmnlm.c | 2+-
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/cgmnlm b/cgmnlm Binary files differ. diff --git a/src/cgmnlm.c b/src/cgmnlm.c @@ -795,7 +795,7 @@ repeat: break; case GEMINI_LINK: if (text == NULL) { - col += fprintf(out, "%2d) %s", nlinks++, ANSI_COLOR_CYAN); + col += fprintf(out, "%2d) %s", nlinks++, (!strncmp("gemini://", tok.link.url, 9) || strstr(tok.link.url, "://") == NULL) ? ANSI_COLOR_CYAN : ANSI_COLOR_MAGENTA ); text = trim_ws(tok.link.text ? tok.link.text : tok.link.url); *next = calloc(1, sizeof(struct link)); (*next)->url = strdup(trim_ws(tok.link.url));