summaryrefslogtreecommitdiffstats
path: root/src/api.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api.c b/src/api.c
index b0ef96d..e5fbbf9 100644
--- a/src/api.c
+++ b/src/api.c
@@ -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);