After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680459 - Extra newline char in local implementation of g_application_command_line_print/err
Extra newline char in local implementation of g_application_command_line_prin...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
2.33.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-07-23 15:36 UTC by Brian Koning
Modified: 2012-08-06 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The small example program to reproduce the problem. (1.07 KB, text/x-csrc)
2012-07-23 15:36 UTC, Brian Koning
  Details
Patch to remove the two extra newline chars. (1.31 KB, patch)
2012-07-23 15:38 UTC, Brian Koning
none Details | Review
Patch to remove the two extra newline chars. (1.31 KB, patch)
2012-07-23 15:48 UTC, Brian Koning
accepted-commit_now Details | Review
Remove extra newline chars in local g_application_command_line_print/err (1.36 KB, patch)
2012-08-06 14:18 UTC, Matthias Clasen
committed Details | Review

Description Brian Koning 2012-07-23 15:36:36 UTC
Created attachment 219503 [details]
The small example program to reproduce the problem.

There is an extra newline char in the g_print string used by the local implementations of g_application_command_line_print() and g_application_command_line_printerr() functions.

This causes an unwanted extra newline after printing any string with the local GApplicationCommandLine. According to the documentation, these functions are "... exactly equivalent to g_print/err()".

Attached is a small example program to reproduce the problem with the g_application_command_line_print() function.
Comment 1 Brian Koning 2012-07-23 15:37:30 UTC
I have attached a patch removing the two extra newline chars.
Comment 2 Brian Koning 2012-07-23 15:38:05 UTC
Created attachment 219504 [details] [review]
Patch to remove the two extra newline chars.
Comment 3 Brian Koning 2012-07-23 15:48:39 UTC
Created attachment 219505 [details] [review]
Patch to remove the two extra newline chars.
Comment 4 Allison Karlitskaya (desrt) 2012-07-23 16:05:21 UTC
Review of attachment 219505 [details] [review]:

Looks good (particularly in light of the documentation and the fact that the D-Bus implementation of it doesn't add newlines).
Comment 5 Matthias Clasen 2012-08-06 14:17:57 UTC
The following fix has been pushed:
10474ac Remove extra newline chars in local g_application_command_line_print/err
Comment 6 Matthias Clasen 2012-08-06 14:18:00 UTC
Created attachment 220450 [details] [review]
Remove extra newline chars in local g_application_command_line_print/err

The extra newline chars in the local implementation of g_application_command_line_print and g_application_command_line_printerr() cause an unwanted newline after printed strings. This patch removes the newline chars to make the functions consistent with their documentation.