Mercurial > irccd
comparison plugins/links/links.c @ 1031:a20060091063
plugin links: whitespace
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 02 Mar 2021 20:01:00 +0100 |
parents | a35537c50f09 |
children | 330a5db51c62 |
comparison
equal
deleted
inserted
replaced
1030:509bcfb14670 | 1031:a20060091063 |
---|---|
81 { | 81 { |
82 regex_t regex; | 82 regex_t regex; |
83 regmatch_t match[2]; | 83 regmatch_t match[2]; |
84 char *ret = NULL; | 84 char *ret = NULL; |
85 | 85 |
86 if (regcomp(®ex, "<title>([^<]+)<\\/title>", REG_EXTENDED | REG_ICASE) != 0) | 86 if (regcomp(®ex, "<title>([^<]+)<\\/title>", REG_EXTENDED | REG_ICASE) != 0) |
87 return NULL; | 87 return NULL; |
88 | 88 |
89 if (regexec(®ex, req->buf, 2, match, 0) == 0) { | 89 if (regexec(®ex, req->buf, 2, match, 0) == 0) { |
90 ret = &req->buf[match[1].rm_so]; | 90 ret = &req->buf[match[1].rm_so]; |
91 ret[match[1].rm_eo - match[1].rm_so] = '\0'; | 91 ret[match[1].rm_eo - match[1].rm_so] = '\0'; |