summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/plugins/script/script-action.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index d24485ffe..14fe76e8f 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -88,6 +88,7 @@ Bug fixes::
* irc: add messages 415 (cannot send message to channel) and 742 (mode cannot be set)
* lua: fix crash with print when the value to print is not a string (issue #1904, issue #1905)
* ruby: fix crash on quit when a child process is still running (issue #1889, issue #1915)
+ * script: remove trailing "J" (line feed char) in source of scripts displayed
* spell: check buffer pointer received in info "spell_dict"
* trigger: make default triggers "cmd_pass", "cmd_pass_register" and "server_pass" compatible with multiline input (issue #1935)
* typing: fix crash when pointer buffer is not received in callback for signal "input_text_changed" (issue #1869)
diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c
index 89994a1fe..551733c2f 100644
--- a/src/plugins/script/script-action.c
+++ b/src/plugins/script/script-action.c
@@ -993,6 +993,15 @@ script_action_show_source_process_cb (const void *pointer, void *data,
ptr_line = fgets (line, sizeof (line) - 1, file);
if (ptr_line)
{
+ /* remove trailing '\r' and '\n' */
+ length = strlen (line) - 1;
+ while ((length >= 0)
+ && ((line[length] == '\n')
+ || (line[length] == '\r')))
+ {
+ line[length] = '\0';
+ length--;
+ }
weechat_printf_y (script_buffer,
script_buffer_detail_script_last_line++,
"%s", ptr_line);