diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-14 16:05:43 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-14 16:05:43 +0200 |
commit | dff20632ff12ed40b81e94b4f9cb97203feb6deb (patch) | |
tree | 97a191bd5a671506a0fdb555feefde614a34baea /src | |
parent | 32751e59ca9f5963958b099c8de44f3886787866 (diff) | |
download | weechat-dff20632ff12ed40b81e94b4f9cb97203feb6deb.zip |
script: fix display of curl errors
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/script/script-action.c | 12 | ||||
-rw-r--r-- | src/plugins/script/script-repo.c | 5 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index 9715bf872..3f2423a70 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -506,20 +506,23 @@ script_action_install_process_cb (void *data, const char *command, int quiet, length; struct t_script_repo *ptr_script; + /* make C compiler happy */ + (void) out; + quiet = (data) ? 1 : 0; if (return_code >= 0) { pos = strrchr (command, '/'); - if ((err && err[0]) || (out && (strncmp (out, "error:", 6) == 0))) + if (err && err[0]) { weechat_printf (NULL, _("%s%s: error downloading script \"%s\": %s"), weechat_prefix ("error"), SCRIPT_PLUGIN_NAME, (pos) ? pos + 1 : "?", - (err && err[0]) ? err : out + 6); + err); return WEECHAT_RC_OK; } @@ -901,19 +904,20 @@ script_action_show_source_process_cb (void *data, const char *command, /* make C compiler happy */ (void) data; + (void) out; if (return_code >= 0) { pos = strrchr (command, '/'); - if ((err && err[0]) || (out && (strncmp (out, "error:", 6) == 0))) + if (err && err[0]) { weechat_printf (NULL, _("%s%s: error downloading script \"%s\": %s"), weechat_prefix ("error"), SCRIPT_PLUGIN_NAME, (pos) ? pos + 1 : "?", - (err && err[0]) ? err : out + 6); + err); return WEECHAT_RC_OK; } diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index bc7756a16..a3e6d7cd7 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -1405,18 +1405,19 @@ script_repo_file_update_process_cb (void *data, const char *command, /* make C compiler happy */ (void) command; + (void) out; quiet = (data == 0) ? 0 : 1; if (return_code >= 0) { - if ((err && err[0]) || (out && (strncmp (out, "error:", 6) == 0))) + if (err && err[0]) { weechat_printf (NULL, _("%s%s: error downloading list of scripts: %s"), weechat_prefix ("error"), SCRIPT_PLUGIN_NAME, - (err && err[0]) ? err : out + 6); + err); return WEECHAT_RC_OK; } |