exec: fix use of same task id for different tasks (closes #1491)

This commit is contained in:
Sébastien Helleu 2020-05-03 16:07:11 +02:00
parent df26301d03
commit 5438f62f74
18 changed files with 100 additions and 110 deletions

View File

@ -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

View File

@ -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 <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\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

View File

@ -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 <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"

View File

@ -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 <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@ -5889,12 +5889,12 @@ msgstr ""
msgid "Execution of external commands in WeeChat"
msgstr "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: コマンド %d (\"%s\") が終了、リターンコード: %d"
#, c-format
msgid "%s: unexpected end of command %d (\"%s\")"
#, fuzzy, c-format
msgid "%s: unexpected end of command %ld (\"%s\")"
msgstr "%s: コマンド %d (\"%s\") が予期せず終了"
msgid "Executed commands"
@ -5922,8 +5922,8 @@ msgid "%ds"
msgstr "%d 秒"
#. 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、%s 前に開始)"
#, c-format

View File

@ -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: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\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

View File

@ -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 <vascomalmeida@sapo.pt>\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

View File

@ -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 <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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 <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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

View File

@ -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),

View File

@ -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)

View File

@ -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);

View File

@ -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) */