diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 7830efaf1..9d00d4fb6 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -40,6 +40,7 @@ Bug fixes:: * core: fix WEECHAT_SHAREDIR with CMake build (issue #1461) * core: fix memory leak in calculation of expression on FreeBSD (issue #1469) * core: fix resize of a bar when its size is 0 (automatic) (issue #1470) + * exec: fix use of same task id for different tasks (issue #1491) * fifo: fix errors when writing in the FIFO pipe (issue #713) * python: fix crash when invalid UTF-8 string is in a WeeChat hashtable converted to a Python dict (issue #1463) * relay: fix slow send of data to clients when SSL is enabled diff --git a/po/cs.po b/po/cs.po index c3a16d227..1b9d26d5b 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -5207,12 +5207,12 @@ msgstr "" msgid "Execution of external commands in WeeChat" msgstr "Spouštění externích příkazů v WeeChatu" -#, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +#, fuzzy, c-format +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "%s: konec příkazu %d (\"%s\"), návratový kód: %d" -#, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +#, fuzzy, c-format +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "%s: neočekávaný konec příkazu %d (\"%s\")" msgid "Executed commands" @@ -5240,8 +5240,8 @@ msgid "%ds" msgstr "%ds" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" -#, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +#, fuzzy, c-format +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (proces id: %d, byl spuštěn před %s)" #, c-format diff --git a/po/de.po b/po/de.po index ba15d3749..d929c2e28 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-29 09:20+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -6316,12 +6316,12 @@ msgstr "" msgid "Execution of external commands in WeeChat" msgstr "Ausführung externer Befehle in WeeChat" -#, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +#, fuzzy, c-format +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "%s: Befehl %d (\"%s\") wurde beendet, Rückgabewert: %d" -#, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +#, fuzzy, c-format +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "%s: unerwartetes Ende von Befehl %d (\"%s\")" msgid "Executed commands" @@ -6349,8 +6349,8 @@ msgid "%ds" msgstr "%dSek" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" -#, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +#, fuzzy, c-format +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, gestartet vor %s)" #, c-format diff --git a/po/es.po b/po/es.po index e14f91047..1c7f68c54 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5408,11 +5408,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -5443,7 +5443,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s[%s%d%s]%s (%s) %s%s%s (aviso: %s)" #, fuzzy, c-format diff --git a/po/fr.po b/po/fr.po index 26fd87fda..581d9de93 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" -"PO-Revision-Date: 2020-04-28 16:40+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" +"PO-Revision-Date: 2020-05-03 16:05+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6174,12 +6174,12 @@ msgid "Execution of external commands in WeeChat" msgstr "Exécution de commandes externes dans WeeChat" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" -msgstr "%s : fin de la commande %d (\"%s\"), code retour : %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" +msgstr "%s : fin de la commande %ld (\"%s\"), code retour : %d" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" -msgstr "%s : fin inattendue de la commande %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" +msgstr "%s : fin inattendue de la commande %ld (\"%s\")" msgid "Executed commands" msgstr "Commandes exécutées" @@ -6207,8 +6207,8 @@ msgstr "%ds" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" -msgstr " %s%s%s %d%s%s%s : %s\"%s%s%s\"%s (pid : %d, démarré il y a %s)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgstr " %s%s%s %ld%s%s%s : %s\"%s%s%s\"%s (pid : %d, démarré il y a %s)" #, c-format msgid "%s%s: command id \"%s\" not found" diff --git a/po/hu.po b/po/hu.po index 0175d4f6e..f9b4dd29f 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4743,11 +4743,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -4778,7 +4778,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr "%s%s %s(%s%s%s)%s kilépett" #, fuzzy, c-format diff --git a/po/it.po b/po/it.po index 4eeef6a1e..ccf3ff8eb 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5573,11 +5573,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -5608,7 +5608,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s[%s%d%s]%s (%s) %s%s%s (notifica: %s)" #, fuzzy, c-format diff --git a/po/ja.po b/po/ja.po index 010e80591..f86baace5 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -6024,12 +6024,12 @@ msgstr "" msgid "Execution of external commands in WeeChat" msgstr "Wykonywanie zewnętrznych komend w WeeChat" -#, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +#, fuzzy, c-format +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "%s: koniec komendy %d (\"%s\"), zwrócony kod: %d" -#, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +#, fuzzy, c-format +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "%s: nieoczekiwany koniec komendy %d (\"%s\")" msgid "Executed commands" @@ -6057,8 +6057,8 @@ msgid "%ds" msgstr "%ds" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" -#, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +#, fuzzy, c-format +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, uruchomiono %s temu)" #, c-format diff --git a/po/pt.po b/po/pt.po index 0d0c3ce88..83215878a 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5841,12 +5841,12 @@ msgstr "" msgid "Execution of external commands in WeeChat" msgstr "Execução de comandos externos no WeeChat" -#, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +#, fuzzy, c-format +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "%s: fim do comando %d (\"%s\"), código de retorno: %d" -#, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +#, fuzzy, c-format +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "%s: fim de comando inesperado %d (\"%s\")" msgid "Executed commands" @@ -5874,8 +5874,8 @@ msgid "%ds" msgstr "%ds" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" -#, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +#, fuzzy, c-format +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, iniciado há %s atrás)" #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index c03a5cdb7..0a6bf77d1 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-18 11:34+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -5382,11 +5382,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -5417,7 +5417,7 @@ msgstr "%ds" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s[%s%d%s]%s (%s) %s%s%s (notificar: %s)" #, fuzzy, c-format diff --git a/po/ru.po b/po/ru.po index 43313b9f2..86e706da7 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2020-04-28 16:40+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4780,11 +4780,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -4815,7 +4815,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr "%s%s %s(%s%s%s)%s вышел" #, fuzzy, c-format diff --git a/po/tr.po b/po/tr.po index 08f63f80d..07aba208b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2019-11-03 08:38+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -4336,11 +4336,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" #, fuzzy @@ -4370,7 +4370,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, fuzzy, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr " %s[%s%d%s]%s (%s) %s%s%s (notify: %s)" #, fuzzy, c-format diff --git a/po/weechat.pot b/po/weechat.pot index fe105c9c4..1602a3ceb 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2020-04-28 16:39+0200\n" +"POT-Creation-Date: 2020-05-03 16:04+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4318,11 +4318,11 @@ msgid "Execution of external commands in WeeChat" msgstr "" #, c-format -msgid "%s: end of command %d (\"%s\"), return code: %d" +msgid "%s: end of command %ld (\"%s\"), return code: %d" msgstr "" #, c-format -msgid "%s: unexpected end of command %d (\"%s\")" +msgid "%s: unexpected end of command %ld (\"%s\")" msgstr "" msgid "Executed commands" @@ -4351,7 +4351,7 @@ msgstr "" #. TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" #, c-format -msgid " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" +msgid " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, started %s ago)" msgstr "" #, c-format diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c index 917079f91..d90f0d7a2 100644 --- a/src/plugins/exec/exec-command.c +++ b/src/plugins/exec/exec-command.c @@ -87,7 +87,7 @@ exec_command_list () /* running command */ weechat_printf (NULL, /* TRANSLATORS: %s before "ago" is elapsed time, for example: "3m59" */ - _(" %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (pid: %d, " + _(" %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (pid: %d, " "started %s ago)"), weechat_color (weechat_config_string (exec_config_color_flag_running)), ">>", @@ -116,7 +116,7 @@ exec_command_list () "%Y-%m-%d %H:%M:%S", local_time) == 0) str_time2[0] = '\0'; weechat_printf (NULL, - " %s%s%s %d%s%s%s: %s\"%s%s%s\"%s (%s -> %s, %s)", + " %s%s%s %ld%s%s%s: %s\"%s%s%s\"%s (%s -> %s, %s)", weechat_color (weechat_config_string (exec_config_color_flag_finished)), "[]", weechat_color ("reset"), @@ -553,7 +553,7 @@ exec_command_run (struct t_gui_buffer *buffer, else { snprintf (str_buffer, sizeof (str_buffer), - "exec.%d", new_exec_cmd->number); + "exec.%ld", new_exec_cmd->number); } ptr_new_buffer = exec_buffer_new (str_buffer, (cmd_options.new_buffer == 2), diff --git a/src/plugins/exec/exec-completion.c b/src/plugins/exec/exec-completion.c index b823683b9..72f703520 100644 --- a/src/plugins/exec/exec-completion.c +++ b/src/plugins/exec/exec-completion.c @@ -49,7 +49,8 @@ exec_completion_commands_ids_cb (const void *pointer, void *data, for (ptr_exec_cmd = exec_cmds; ptr_exec_cmd; ptr_exec_cmd = ptr_exec_cmd->next_cmd) { - snprintf (str_number, sizeof (str_number), "%d", ptr_exec_cmd->number); + snprintf (str_number, sizeof (str_number), + "%ld", ptr_exec_cmd->number); weechat_hook_completion_list_add (completion, str_number, 0, WEECHAT_LIST_POS_SORT); if (ptr_exec_cmd->name) diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c index f8aeba3aa..b6312f472 100644 --- a/src/plugins/exec/exec.c +++ b/src/plugins/exec/exec.c @@ -95,7 +95,7 @@ exec_search_by_id (const char *id) ptr_exec_cmd = ptr_exec_cmd->next_cmd) { /* check if number is matching */ - if ((number >= 0) && (ptr_exec_cmd->number == (int)number)) + if ((number >= 0) && (ptr_exec_cmd->number == number)) return ptr_exec_cmd; /* check if name is matching */ @@ -114,36 +114,14 @@ exec_search_by_id (const char *id) struct t_exec_cmd * exec_add () { - struct t_exec_cmd *new_exec_cmd, *ptr_exec_cmd; - int i, number; - - /* find first available number */ - number = (last_exec_cmd) ? last_exec_cmd->number + 1 : 0; - for (ptr_exec_cmd = exec_cmds; ptr_exec_cmd; - ptr_exec_cmd = ptr_exec_cmd->next_cmd) - { - if (ptr_exec_cmd->prev_cmd - && (ptr_exec_cmd->number > ptr_exec_cmd->prev_cmd->number + 1)) - { - number = ptr_exec_cmd->prev_cmd->number + 1; - break; - } - } + struct t_exec_cmd *new_exec_cmd; + int i; new_exec_cmd = malloc (sizeof (*new_exec_cmd)); if (!new_exec_cmd) return NULL; - new_exec_cmd->prev_cmd = last_exec_cmd; - new_exec_cmd->next_cmd = NULL; - if (last_exec_cmd) - last_exec_cmd->next_cmd = new_exec_cmd; - else - exec_cmds = new_exec_cmd; - - last_exec_cmd = new_exec_cmd; - - new_exec_cmd->number = number; + new_exec_cmd->number = (last_exec_cmd) ? last_exec_cmd->number + 1 : 0; new_exec_cmd->name = NULL; new_exec_cmd->hook = NULL; new_exec_cmd->command = NULL; @@ -166,6 +144,15 @@ exec_add () new_exec_cmd->pipe_command = NULL; new_exec_cmd->hsignal = NULL; + /* add exec to list */ + new_exec_cmd->prev_cmd = last_exec_cmd; + new_exec_cmd->next_cmd = NULL; + if (last_exec_cmd) + last_exec_cmd->next_cmd = new_exec_cmd; + else + exec_cmds = new_exec_cmd; + last_exec_cmd = new_exec_cmd; + exec_cmds_count++; return new_exec_cmd; @@ -343,7 +330,7 @@ exec_display_line (struct t_exec_cmd *exec_cmd, struct t_gui_buffer *buffer, } else { - snprintf (str_number, sizeof (str_number), "%d", exec_cmd->number); + snprintf (str_number, sizeof (str_number), "%ld", exec_cmd->number); snprintf (str_tags, sizeof (str_tags), "exec_%s,exec_cmd_%s", (out == EXEC_STDOUT) ? "stdout" : "stderr", @@ -460,7 +447,8 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) if (hashtable) { weechat_hashtable_set (hashtable, "command", exec_cmd->command); - snprintf (str_number, sizeof (str_number), "%d", exec_cmd->number); + snprintf (str_number, sizeof (str_number), + "%ld", exec_cmd->number); weechat_hashtable_set (hashtable, "number", str_number); weechat_hashtable_set (hashtable, "name", exec_cmd->name); output = exec_decode_color (exec_cmd, exec_cmd->output[EXEC_STDOUT]); @@ -501,8 +489,8 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) if (buffer_type == 1) { weechat_printf_y (ptr_buffer, -1, - ("%s: end of command %d (\"%s\"), " - "return code: %d"), + _("%s: end of command %ld (\"%s\"), " + "return code: %d"), EXEC_PLUGIN_NAME, exec_cmd->number, exec_cmd->command, return_code); } @@ -510,7 +498,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) { weechat_printf_date_tags ( ptr_buffer, 0, "exec_rc", - _("%s: end of command %d (\"%s\"), " + _("%s: end of command %ld (\"%s\"), " "return code: %d"), EXEC_PLUGIN_NAME, exec_cmd->number, exec_cmd->command, return_code); @@ -521,7 +509,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) if (buffer_type == 1) { weechat_printf_y (ptr_buffer, -1, - _("%s: unexpected end of command %d " + _("%s: unexpected end of command %ld " "(\"%s\")"), EXEC_PLUGIN_NAME, exec_cmd->number, exec_cmd->command); @@ -530,7 +518,7 @@ exec_end_command (struct t_exec_cmd *exec_cmd, int return_code) { weechat_printf_date_tags ( ptr_buffer, 0, "exec_rc", - _("%s: unexpected end of command %d " + _("%s: unexpected end of command %ld " "(\"%s\")"), EXEC_PLUGIN_NAME, exec_cmd->number, exec_cmd->command); @@ -685,7 +673,7 @@ exec_print_log () { weechat_log_printf (""); weechat_log_printf ("[exec command (addr:0x%lx)]", ptr_exec_cmd); - weechat_log_printf (" number. . . . . . . . . . : %d", ptr_exec_cmd->number); + weechat_log_printf (" number. . . . . . . . . . : %ld", ptr_exec_cmd->number); weechat_log_printf (" name. . . . . . . . . . . : '%s'", ptr_exec_cmd->name); weechat_log_printf (" hook. . . . . . . . . . . : 0x%lx", ptr_exec_cmd->hook); weechat_log_printf (" command . . . . . . . . . : '%s'", ptr_exec_cmd->command); diff --git a/src/plugins/exec/exec.h b/src/plugins/exec/exec.h index 82bf79280..26492f52f 100644 --- a/src/plugins/exec/exec.h +++ b/src/plugins/exec/exec.h @@ -43,7 +43,7 @@ enum t_exec_color struct t_exec_cmd { /* command/process */ - int number; /* command number */ + long number; /* command number */ char *name; /* name of command */ struct t_hook *hook; /* pointer to process hook */ char *command; /* command (with arguments) */