1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 04:16:38 +02:00

script: fix display of curl errors

This commit is contained in:
Sébastien Helleu
2014-07-14 16:05:43 +02:00
parent 32751e59ca
commit dff20632ff
3 changed files with 12 additions and 6 deletions
+8 -4
View File
@@ -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;
}
+3 -2
View File
@@ -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;
}