1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 12:56:37 +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
+1
View File
@@ -176,6 +176,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* rmodifier: remove plugin (replaced by trigger)
* ruby: fix crash when trying to load a directory with /ruby load
* ruby: add detection of Ruby 2.1
* script: fix display of curl errors
* script: set option script.scripts.cache_expire to 1440 by default
* script: fix scroll on script buffer in the detailed view of script
(closes #6)
+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;
}