summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-06-05 23:47:41 +0200
committerportix <none@none>2012-06-05 23:47:41 +0200
commitab11f0d5e5c757e0ed502f2c92ddb860347c95e7 (patch)
tree7813b67ae9b8e0e6a4239ec02ba9ee7c4d53b5ea /src
parent5901c1f64808f3468c1c202c565d4389caa01be0 (diff)
downloaddwb-ab11f0d5e5c757e0ed502f2c92ddb860347c95e7.zip
Initialize content with NULL in dwb_get_scripts
Diffstat (limited to 'src')
-rw-r--r--src/download.c5
-rw-r--r--src/dwb.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/download.c b/src/download.c
index bf199065..067145a6 100644
--- a/src/download.c
+++ b/src/download.c
@@ -257,15 +257,16 @@ download_delay(DwbDownload *download) {
static void
download_status_cb(WebKitDownload *download, GParamSpec *p, DwbDownloadStatus *dstatus) {
WebKitDownloadStatus status = webkit_download_get_status(download);
+ gboolean script_handled = false;
if (EMIT_SCRIPT(DOWNLOAD_STATUS)) {
ScriptSignal signal = { .jsobj = NULL, { G_OBJECT(download) }, SCRIPTS_SIG_META(NULL, DOWNLOAD_STATUS, 1) };
- scripts_emit(&signal);
+ script_handled = scripts_emit(&signal);
}
if (status == WEBKIT_DOWNLOAD_STATUS_FINISHED || status == WEBKIT_DOWNLOAD_STATUS_CANCELLED || status == WEBKIT_DOWNLOAD_STATUS_ERROR) {
GList *list = download_get_download_label(download);
if (list) {
DwbDownload *label = list->data;
- if (label->action == DL_ACTION_EXECUTE && status == WEBKIT_DOWNLOAD_STATUS_FINISHED) {
+ if (label->action == DL_ACTION_EXECUTE && status == WEBKIT_DOWNLOAD_STATUS_FINISHED && !script_handled) {
download_spawn(label);
}
/* Setting time to 0 will force recomputing size */
diff --git a/src/dwb.c b/src/dwb.c
index 81b86844..c283eb4e 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -2610,8 +2610,8 @@ dwb_execute_user_script(KeyMap *km, Arg *a) {
static GList *
dwb_get_scripts() {
GDir *dir;
- char *filename;
- char *content;
+ char *filename = NULL;
+ char *content = NULL;
GList *gl = NULL;
Navigation *n;
GError *error = NULL;