diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-01-05 22:45:40 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-01-05 22:45:40 +0100 |
commit | c248f539f45eff15760b95c8427328b777b3888d (patch) | |
tree | dbd79f7a90a673376721215eb5381c4fa82d9b50 /src/api.c | |
parent | release 0.0.25 (diff) | |
download | sear.c-0.0.27.tar sear.c-0.0.27.tar.gz sear.c-0.0.27.tar.bz2 sear.c-0.0.27.tar.lz sear.c-0.0.27.tar.xz sear.c-0.0.27.tar.zst sear.c-0.0.27.zip |
Diffstat (limited to '')
-rw-r--r-- | src/api.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -153,6 +153,8 @@ enum sc_return sc_query_google (const char * s, /* breaking change: changed retu char * descclass = NULL; char * titleclass = NULL; char * imageclass = NULL; + char * resultsforclass = NULL; + char * xpathsugg = NULL; htmlDocPtr xmldoc = NULL; char * txtdoc = NULL; int qwasgiven = 0; @@ -182,7 +184,7 @@ enum sc_return sc_query_google (const char * s, /* breaking change: changed retu rs = SC_CAPTCHA; goto rc; } - char * resultsforclass = sc_find_class(txtdoc, "{color:#1967d2}"); + resultsforclass = sc_find_class(txtdoc, "{color:#1967d2}"); if (opt & SC_OPT_IMAGE) { imageclass = sc_find_class(txtdoc, "{font-family:Roboto,Helvetica,Arial,sans-serif}"); if (!imageclass) { @@ -299,7 +301,6 @@ enum sc_return sc_query_google (const char * s, /* breaking change: changed retu } q->string = realloc(q->string, sl+1); strcpy(q->string, s); - char * xpathsugg = NULL; if (resultsforclass) { xpathsugg = malloc(512+strlen(resultsforclass)); sprintf(xpathsugg, "//a[contains(@class, '%s')]", resultsforclass); |