Accepting request 606838 from home:iznogood

- Add gnome-terminal-fix-output-commenting.patch: client: legacy:
  Fix output commenting. Make sure each line starts with '#' even
  if the message contains embedded newlines.

OBS-URL: https://build.opensuse.org/request/show/606838
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-terminal?expand=0&rev=203
This commit is contained in:
Dominique Leuenberger 2018-05-14 07:28:21 +00:00 committed by Git OBS Bridge
parent d072d373d2
commit aa9da36681
3 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,61 @@
From 47a949167af299e40b47fb6caf08ec06373b33d5 Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@src.gnome.org>
Date: Wed, 2 May 2018 19:32:52 +0200
Subject: client: legacy: Fix output commenting
Make sure each line starts with '#' even if the message
contains embedded newlines.
(cherry picked from commit d62c6ee988371cdf2af84a7898cee686c484aff8)
---
src/terminal-options.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/src/terminal-options.c b/src/terminal-options.c
index e00ca92..d1e8a4a 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.c
@@ -41,27 +41,25 @@
static int verbosity = 1;
-/* @freeme is a workaround for Clang; see gnome-terminal bug 790318. */
-static char * G_GNUC_FORMAT (2)
-format_as_comment (char** freeme, const char *format)
-{
- return *freeme = g_strdup_printf ("# %s", format);
-}
-
void
terminal_fprintf (FILE* fp,
int verbosity_level,
const char* format,
...)
{
- if (verbosity < verbosity_level)
- return;
-
- gs_free char* freeme;
- va_list args;
- va_start(args, format);
- g_vfprintf(fp, format_as_comment(&freeme, format), args);
- va_end(args);
+ if (verbosity < verbosity_level)
+ return;
+
+ va_list args;
+ va_start(args, format);
+ gs_free char *str = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ gs_strfreev char **lines = g_strsplit_set(str, "\n\r", -1);
+ for (gsize i = 0; lines[i]; ++i) {
+ if (lines[i][0] != '\0')
+ g_fprintf(fp, "# %s\n", lines[i]);
+ }
}
#if GLIB_CHECK_VERSION (2, 50, 0)
--
cgit v0.12

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu May 3 12:04:03 UTC 2018 - bjorn.lie@gmail.com
- Add gnome-terminal-fix-output-commenting.patch: client: legacy:
Fix output commenting. Make sure each line starts with '#' even
if the message contains embedded newlines.
-------------------------------------------------------------------
Tue Apr 24 15:34:58 UTC 2018 - bjorn.lie@gmail.com

View File

@ -26,6 +26,8 @@ URL: https://wiki.gnome.org/Apps/Terminal
Source: http://download.gnome.org/sources/gnome-terminal/3.28/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM gnome-terminal-translate-encoding-names.patch bgo#795358 -- prefs: editor: Translate encoding names
Patch0: gnome-terminal-translate-encoding-names.patch
# PATCH-FIX-UPSTREAM gnome-terminal-fix-output-commenting.patch -- client: legacy: Fix output commenting
Patch1: gnome-terminal-fix-output-commenting.patch
BuildRequires: fdupes
# Needed for search provider. It should not be needed in my opionion, we have to take this up with upstream, or just provide search provider interface definition file as source.
BuildRequires: gnome-shell